diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-04-03 08:21:37 +0100 |
commit | e800454207f4d7a0c402f129029b8282209cdf74 (patch) | |
tree | 0ce0375c9ffc1f460eb63a6fd9fa23c849241d18 /scp.c | |
parent | 9e45701c5d6105444cc2f4f5d6c44b0f69969479 (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
@@ -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) |