Chip Davis : winegcc: Put quotes around arguments with spaces when printing them.

Alexandre Julliard julliard at winehq.org
Mon Apr 6 15:53:20 CDT 2020


Module: wine
Branch: master
Commit: f83646736b91188c226a86760b41f86449580d12
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f83646736b91188c226a86760b41f86449580d12

Author: Chip Davis <cdavis at codeweavers.com>
Date:   Sun Apr  5 14:45:24 2020 -0500

winegcc: Put quotes around arguments with spaces when printing them.

This makes it easier to copy and paste the command into the shell.

Signed-off-by: Chip Davis <cdavis at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winegcc/utils.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c
index 1a9bc0a63c..cc5d67977f 100644
--- a/tools/winegcc/utils.c
+++ b/tools/winegcc/utils.c
@@ -365,7 +365,11 @@ int spawn(const strarray* prefix, const strarray* args, int ignore_errors)
 
     if (verbose)
     {
-	for(i = 0; argv[i]; i++) printf("%s ", argv[i]);
+	for(i = 0; argv[i]; i++)
+	{
+	    if (strpbrk(argv[i], " \t\n\r")) printf("\"%s\" ", argv[i]);
+	    else printf("%s ", argv[i]);
+	}
 	printf("\n");
     }
 




More information about the wine-cvs mailing list