From 8e902626bda555b8f925cf20b77947e8d9090714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domas=20Tama=C5=A1auskas?= Date: Mon, 20 Jan 2020 20:38:56 +0200 Subject: [PATCH] qt/internal/cmd/deploy: correcly escape ldflags Use fmt.Printf %q verb which automatically double quotes the given string, therefore eliminating the need for double quote escapes. Closes #1045 --- internal/cmd/deploy/build_escape.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cmd/deploy/build_escape.go b/internal/cmd/deploy/build_escape.go index 39aee32cd..3d2a9bca0 100644 --- a/internal/cmd/deploy/build_escape.go +++ b/internal/cmd/deploy/build_escape.go @@ -31,8 +31,8 @@ func escapeFlags(ldFlags []string, ldFlagsCustom string) string { ldFlags = append(ldFlags, strings.Split(ldFlagsCustom, " ")...) } - if out := strings.Replace(strings.Join(ldFlags, "\" \""), "_DONT_ESCAPE_", " ", -1); len(out) > 0 { - return fmt.Sprintf("\"%v\"", out) + if out := strings.Replace(strings.Join(ldFlags, " "), "_DONT_ESCAPE_", " ", -1); len(out) > 0 { + return fmt.Sprintf("%q", out) } return "" }