summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorNicolas Valcárcel <nvalcarcel@ubuntu.com>2014-02-09 16:09:59 +0000
committerColin Watson <cjwatson@debian.org>2016-12-23 11:25:03 +0000
commit43205c71be413d2225ce3ea5cf81d79afd420b81 (patch)
treedcc1ac36cc9ffdcb9dd01a2fb1975361bc6b9d1e /scp.c
parentdf060c830ad66289a93be24268f3f70e7021be29 (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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/scp.c b/scp.c
index b4db85198..18c277201 100644
--- a/scp.c
+++ b/scp.c
@@ -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)