diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-03-21 12:06:15 +0000 |
commit | eca335b47f5cf4adfc64cd17096f83d546fa91da (patch) | |
tree | cef6f814f584787673e2faea10ccc31724cfb9df /scp.c | |
parent | bf0d87583a842b9e8aaf2a9cd9dbc3e976df2af4 (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
@@ -190,8 +190,16 @@ do_local_cmd(arglist *a) | |||
190 | 190 | ||
191 | if (verbose_mode) { | 191 | if (verbose_mode) { |
192 | fprintf(stderr, "Executing:"); | 192 | fprintf(stderr, "Executing:"); |
193 | for (i = 0; i < a->num; i++) | 193 | for (i = 0; i < a->num; i++) { |
194 | fprintf(stderr, " %s", a->list[i]); | 194 | if (i == 0) |
195 | fprintf(stderr, " %s", a->list[i]); | ||
196 | else | ||
197 | /* | ||
198 | * TODO: misbehaves if a->list[i] contains a | ||
199 | * single quote | ||
200 | */ | ||
201 | fprintf(stderr, " '%s'", a->list[i]); | ||
202 | } | ||
195 | fprintf(stderr, "\n"); | 203 | fprintf(stderr, "\n"); |
196 | } | 204 | } |
197 | if ((pid = fork()) == -1) | 205 | if ((pid = fork()) == -1) |