diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-06-07 10:25:35 +0100 |
commit | 2520672d1ccfd88744c93bac102f461f9b1e0cf3 (patch) | |
tree | 76d0df2d707ccffa8ab1d20eaa6c49f9f60aa476 | |
parent | cb72edd9757c469f3b5dc9cde374715ae8b54509 (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
@@ -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) |