diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-10-04 13:54:48 +0100 |
commit | ef7aa8189491e0b43f14f7f15fb5e66903f7e185 (patch) | |
tree | 532624012e1e8749830f2813ff3b41df50e12267 | |
parent | b1033fed87fd9fa24dccab45f00cadcbc7144c47 (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
@@ -194,8 +194,16 @@ do_local_cmd(arglist *a) | |||
194 | 194 | ||
195 | if (verbose_mode) { | 195 | if (verbose_mode) { |
196 | fprintf(stderr, "Executing:"); | 196 | fprintf(stderr, "Executing:"); |
197 | for (i = 0; i < a->num; i++) | 197 | for (i = 0; i < a->num; i++) { |
198 | fmprintf(stderr, " %s", a->list[i]); | 198 | if (i == 0) |
199 | fmprintf(stderr, " %s", a->list[i]); | ||
200 | else | ||
201 | /* | ||
202 | * TODO: misbehaves if a->list[i] contains a | ||
203 | * single quote | ||
204 | */ | ||
205 | fmprintf(stderr, " '%s'", a->list[i]); | ||
206 | } | ||
199 | fprintf(stderr, "\n"); | 207 | fprintf(stderr, "\n"); |
200 | } | 208 | } |
201 | if ((pid = fork()) == -1) | 209 | if ((pid = fork()) == -1) |