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>2019-10-09 23:07:49 +0100
commit2d8e679834c81fc381d02974986e08cafe3efa29 (patch)
tree46b721cf995e9beca466245a5e0c4791b0ab55eb /scp.c
parent19f1d075a06f4d3c9b440d7272272569d8bb0a17 (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 0348d0673..5a7a92a7e 100644
--- a/scp.c
+++ b/scp.c
@@ -199,8 +199,16 @@ do_local_cmd(arglist *a)
199 199
200 if (verbose_mode) { 200 if (verbose_mode) {
201 fprintf(stderr, "Executing:"); 201 fprintf(stderr, "Executing:");
202 for (i = 0; i < a->num; i++) 202 for (i = 0; i < a->num; i++) {
203 fmprintf(stderr, " %s", a->list[i]); 203 if (i == 0)
204 fmprintf(stderr, " %s", a->list[i]);
205 else
206 /*
207 * TODO: misbehaves if a->list[i] contains a
208 * single quote
209 */
210 fmprintf(stderr, " '%s'", a->list[i]);
211 }
204 fprintf(stderr, "\n"); 212 fprintf(stderr, "\n");
205 } 213 }
206 if ((pid = fork()) == -1) 214 if ((pid = fork()) == -1)