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

Gbp-Pq: Name scp-quoting.patch
This commit is contained in:
Nicolas Valcárcel 2014-02-09 16:09:59 +00:00 committed by lixiuwen
parent f557b572cf
commit e14360c682
1 changed files with 10 additions and 2 deletions

12
scp.c
View File

@ -239,8 +239,16 @@ do_local_cmd(arglist *a)
if (verbose_mode) {
fprintf(stderr, "Executing:");
for (i = 0; i < a->num; i++)
fmprintf(stderr, " %s", a->list[i]);
for (i = 0; i < a->num; i++) {
if (i == 0)
fmprintf(stderr, " %s", a->list[i]);
else
/*
* TODO: misbehaves if a->list[i] contains a
* single quote
*/
fmprintf(stderr, " '%s'", a->list[i]);
}
fprintf(stderr, "\n");
}
if ((pid = fork()) == -1)