diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-03-29 01:39:47 +0100 |
commit | 17d18d2f87eaa6c781356a78800ee17ccd12218b (patch) | |
tree | 4e40b59037bfc5a39d1202fdce75ad4252bb5952 /scp.c | |
parent | 0b9c0482cbff9ce16384e4247d955676d4d77df3 (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
@@ -191,8 +191,16 @@ do_local_cmd(arglist *a) | |||
191 | 191 | ||
192 | if (verbose_mode) { | 192 | if (verbose_mode) { |
193 | fprintf(stderr, "Executing:"); | 193 | fprintf(stderr, "Executing:"); |
194 | for (i = 0; i < a->num; i++) | 194 | for (i = 0; i < a->num; i++) { |
195 | fmprintf(stderr, " %s", a->list[i]); | 195 | if (i == 0) |
196 | fmprintf(stderr, " %s", a->list[i]); | ||
197 | else | ||
198 | /* | ||
199 | * TODO: misbehaves if a->list[i] contains a | ||
200 | * single quote | ||
201 | */ | ||
202 | fmprintf(stderr, " '%s'", a->list[i]); | ||
203 | } | ||
196 | fprintf(stderr, "\n"); | 204 | fprintf(stderr, "\n"); |
197 | } | 205 | } |
198 | if ((pid = fork()) == -1) | 206 | if ((pid = fork()) == -1) |