diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-01-16 15:02:54 +0000 |
commit | cfc11fb9604f8049957a409ff0835f642a047496 (patch) | |
tree | 655df60e29ac2ce82774243ce2487cce10b393d8 | |
parent | c20ad02ad58a523c6f4974e1ca124e71b7b801b1 (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
@@ -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) |