summaryrefslogtreecommitdiff
path: root/debian/patches/scp-quoting.patch
blob: 7749c8ea37829e22031426c1a1bd69c40ec065bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 8ab204ee192e655d5a8f4d599adb3d99eeabedc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20Valc=C3=A1rcel?= <nvalcarcel@ubuntu.com>
Date: Sun, 9 Feb 2014 16:09:59 +0000
Subject: 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
---
 scp.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/scp.c b/scp.c
index 18d3b1d..0669d02 100644
--- a/scp.c
+++ b/scp.c
@@ -189,8 +189,16 @@ do_local_cmd(arglist *a)
 
 	if (verbose_mode) {
 		fprintf(stderr, "Executing:");
-		for (i = 0; i < a->num; i++)
-			fprintf(stderr, " %s", a->list[i]);
+		for (i = 0; i < a->num; i++) {
+			if (i == 0)
+				fprintf(stderr, " %s", a->list[i]);
+			else
+				/*
+				 * TODO: misbehaves if a->list[i] contains a
+				 * single quote
+				 */
+				fprintf(stderr, " '%s'", a->list[i]);
+		}
 		fprintf(stderr, "\n");
 	}
 	if ((pid = fork()) == -1)