diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-08-24 17:49:07 +0100 |
commit | f14447b774639c6de52f452e5a0e012939832855 (patch) | |
tree | 71f8601dde3c5efcee346e7aa0de5de15c03db72 /scp.c | |
parent | 840f43066f9cdf5f6bb07992aca1c5f43be8eb80 (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
@@ -198,8 +198,16 @@ do_local_cmd(arglist *a) | |||
198 | 198 | ||
199 | if (verbose_mode) { | 199 | if (verbose_mode) { |
200 | fprintf(stderr, "Executing:"); | 200 | fprintf(stderr, "Executing:"); |
201 | for (i = 0; i < a->num; i++) | 201 | for (i = 0; i < a->num; i++) { |
202 | fmprintf(stderr, " %s", a->list[i]); | 202 | if (i == 0) |
203 | fmprintf(stderr, " %s", a->list[i]); | ||
204 | else | ||
205 | /* | ||
206 | * TODO: misbehaves if a->list[i] contains a | ||
207 | * single quote | ||
208 | */ | ||
209 | fmprintf(stderr, " '%s'", a->list[i]); | ||
210 | } | ||
203 | fprintf(stderr, "\n"); | 211 | fprintf(stderr, "\n"); |
204 | } | 212 | } |
205 | if ((pid = fork()) == -1) | 213 | if ((pid = fork()) == -1) |