diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-08-07 12:18:43 +0100 |
commit | 119936d7b64829f81cbc84c2e81bf23373c6ed37 (patch) | |
tree | 646699a026a83dc735d9279d2e0ea0cdb11aa70d /scp.c | |
parent | 563974a78e937c4844e1198b5f6d79b8b2b5c600 (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
@@ -192,8 +192,16 @@ do_local_cmd(arglist *a) | |||
192 | 192 | ||
193 | if (verbose_mode) { | 193 | if (verbose_mode) { |
194 | fprintf(stderr, "Executing:"); | 194 | fprintf(stderr, "Executing:"); |
195 | for (i = 0; i < a->num; i++) | 195 | for (i = 0; i < a->num; i++) { |
196 | fmprintf(stderr, " %s", a->list[i]); | 196 | if (i == 0) |
197 | fmprintf(stderr, " %s", a->list[i]); | ||
198 | else | ||
199 | /* | ||
200 | * TODO: misbehaves if a->list[i] contains a | ||
201 | * single quote | ||
202 | */ | ||
203 | fmprintf(stderr, " '%s'", a->list[i]); | ||
204 | } | ||
197 | fprintf(stderr, "\n"); | 205 | fprintf(stderr, "\n"); |
198 | } | 206 | } |
199 | if ((pid = fork()) == -1) | 207 | if ((pid = fork()) == -1) |