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