diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:18:16 +0000 |
commit | 7531f41888f9e40be95a319fb325f6f05dd50751 (patch) | |
tree | a67f0a67d7d6d7e77483feb642bac31dc76c960a /scp.c | |
parent | 7016a7e8a6b854833132db253fd5e392984bd4ea (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
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -189,8 +189,16 @@ do_local_cmd(arglist *a) | |||
189 | 189 | ||
190 | if (verbose_mode) { | 190 | if (verbose_mode) { |
191 | fprintf(stderr, "Executing:"); | 191 | fprintf(stderr, "Executing:"); |
192 | for (i = 0; i < a->num; i++) | 192 | for (i = 0; i < a->num; i++) { |
193 | fprintf(stderr, " %s", a->list[i]); | 193 | if (i == 0) |
194 | fprintf(stderr, " %s", a->list[i]); | ||
195 | else | ||
196 | /* | ||
197 | * TODO: misbehaves if a->list[i] contains a | ||
198 | * single quote | ||
199 | */ | ||
200 | fprintf(stderr, " '%s'", a->list[i]); | ||
201 | } | ||
194 | fprintf(stderr, "\n"); | 202 | fprintf(stderr, "\n"); |
195 | } | 203 | } |
196 | if ((pid = fork()) == -1) | 204 | if ((pid = fork()) == -1) |