summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Valcárcel <nvalcarcel@ubuntu.com>2014-02-09 16:09:59 +0000
committerColin Watson <cjwatson@debian.org>2020-02-21 12:06:07 +0000
commit5166a6af68da4778c7e2c2d117bb56361c7aa361 (patch)
treecf041839c1613ee24373a79d3d919ee8e2d8d336
parent3309e464e5ae6c940ddd584eed4d2d403f4c168c (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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/scp.c b/scp.c
index 6901e0c94..9b64aa5f4 100644
--- a/scp.c
+++ b/scp.c
@@ -201,8 +201,16 @@ do_local_cmd(arglist *a)
201 201
202 if (verbose_mode) { 202 if (verbose_mode) {
203 fprintf(stderr, "Executing:"); 203 fprintf(stderr, "Executing:");
204 for (i = 0; i < a->num; i++) 204 for (i = 0; i < a->num; i++) {
205 fmprintf(stderr, " %s", a->list[i]); 205 if (i == 0)
206 fmprintf(stderr, " %s", a->list[i]);
207 else
208 /*
209 * TODO: misbehaves if a->list[i] contains a
210 * single quote
211 */
212 fmprintf(stderr, " '%s'", a->list[i]);
213 }
206 fprintf(stderr, "\n"); 214 fprintf(stderr, "\n");
207 } 215 }
208 if ((pid = fork()) == -1) 216 if ((pid = fork()) == -1)