diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-10-20 22:54:09 +0100 |
commit | eefdc7046766b52e39f1b6eafcde22c1e013ce9f (patch) | |
tree | 6a773a38a356e59c3c322ef2b581c056fd2de93d | |
parent | 7b931d36ad36a93d2b1811858ca29408ec44ecae (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
@@ -198,8 +198,16 @@ do_local_cmd(arglist *a) | |||
198 | 198 | ||
199 | if (verbose_mode) { | 199 | if (verbose_mode) { |
200 | fprintf(stderr, "Executing:"); | 200 | fprintf(stderr, "Executing:"); |
201 | for (i = 0; i < a->num; i++) | 201 | for (i = 0; i < a->num; i++) { |
202 | fmprintf(stderr, " %s", a->list[i]); | 202 | if (i == 0) |
203 | fmprintf(stderr, " %s", a->list[i]); | ||
204 | else | ||
205 | /* | ||
206 | * TODO: misbehaves if a->list[i] contains a | ||
207 | * single quote | ||
208 | */ | ||
209 | fmprintf(stderr, " '%s'", a->list[i]); | ||
210 | } | ||
203 | fprintf(stderr, "\n"); | 211 | fprintf(stderr, "\n"); |
204 | } | 212 | } |
205 | if ((pid = fork()) == -1) | 213 | if ((pid = fork()) == -1) |