Skip to content

Commit 6662239

Browse files
committed
upstream: correctly quote filenames in verbose output for local->local
copies; from Colin Watson via bz3900; ok dtucker@ OpenBSD-Commit-ID: 5c09b030e2024651ebc8c1f9af6a8a2d37912150
1 parent 8fce552 commit 6662239

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

scp.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: scp.c,v 1.269 2025/10/13 00:53:51 djm Exp $ */
1+
/* $OpenBSD: scp.c,v 1.270 2025/12/03 06:29:50 djm Exp $ */
22
/*
33
* scp - secure remote copy. This is basically patched BSD rcp which
44
* uses ssh to do the data transfer (instead of using rcmd).
@@ -216,18 +216,17 @@ suspchild(int signo)
216216
static int
217217
do_local_cmd(arglist *a)
218218
{
219-
u_int i;
219+
char *cp;
220220
int status;
221221
pid_t pid;
222222

223223
if (a->num == 0)
224224
fatal("do_local_cmd: no arguments");
225225

226226
if (verbose_mode) {
227-
fprintf(stderr, "Executing:");
228-
for (i = 0; i < a->num; i++)
229-
fmprintf(stderr, " %s", a->list[i]);
230-
fprintf(stderr, "\n");
227+
cp = argv_assemble(a->num, a->list);
228+
fmprintf(stderr, "Executing: %s\n", cp);
229+
free(cp);
231230
}
232231
if ((pid = fork()) == -1)
233232
fatal("do_local_cmd: fork: %s", strerror(errno));

0 commit comments

Comments
 (0)