diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-12-28 20:05:05 +0000 |
commit | 5362ffb871dbb4ca9f19f25756eee0a88cd177e8 (patch) | |
tree | 68a2586c55b164429df030103d621417de7a9066 /scp.c | |
parent | 5ba9e0eff0a725c4d616f296c6449fe3dbe0bdcf (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) |