diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-10-18 12:07:21 +0100 |
commit | 94f06f8888f2e11267120eeebdb931d95bbfb7fd (patch) | |
tree | 8b9d3da412e2e25ce4bed232a5ccfc0394558649 | |
parent | d08cd2b0cfbedf3ccd2ec3adaef850b8d9a87e85 (diff) |
Adjust scp quoting in verbose mode
Tweak scp's reporting of filenames in verbose mode to be a bit less
confusing with spaces.
This should be revised to mimic real shell quoting.
Bug-Ubuntu: https://bugs.launchpad.net/bugs/89945
Last-Update: 2010-02-27
Patch-Name: scp-quoting.patch
-rw-r--r-- | scp.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -201,8 +201,16 @@ do_local_cmd(arglist *a) | |||
201 | 201 | ||
202 | if (verbose_mode) { | 202 | if (verbose_mode) { |
203 | fprintf(stderr, "Executing:"); | 203 | fprintf(stderr, "Executing:"); |
204 | for (i = 0; i < a->num; i++) | 204 | for (i = 0; i < a->num; i++) { |
205 | fmprintf(stderr, " %s", a->list[i]); | 205 | if (i == 0) |
206 | fmprintf(stderr, " %s", a->list[i]); | ||
207 | else | ||
208 | /* | ||
209 | * TODO: misbehaves if a->list[i] contains a | ||
210 | * single quote | ||
211 | */ | ||
212 | fmprintf(stderr, " '%s'", a->list[i]); | ||
213 | } | ||
206 | fprintf(stderr, "\n"); | 214 | fprintf(stderr, "\n"); |
207 | } | 215 | } |
208 | if ((pid = fork()) == -1) | 216 | if ((pid = fork()) == -1) |