diff options
author | Nicolas Valcárcel <nvalcarcel@ubuntu.com> | 2014-02-09 16:09:59 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2019-06-05 13:11:52 +0100 |
commit | 76a51e544a6a6a674ff1dddf4bb6da05d9cce774 (patch) | |
tree | d3d026947d10e7c67f4ab1fd49ad4c152c952765 | |
parent | e04a43bd5798ba43d910493d179438845e96f631 (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) |