You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2019/02/27 18:42:28 UTC

[mynewt-newt] branch master updated: Don't escape curly braces in an MSYS environment

This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
     new 7f01222  Don't escape curly braces in an MSYS environment
7f01222 is described below

commit 7f01222d37c6a1b2312ecc40b3f3040bb3df85af
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Wed Feb 20 13:43:54 2019 -0800

    Don't escape curly braces in an MSYS environment
    
    In Windows, curly braces ('{', '}') need to be escaped with backslashes.
    However, Unix-like shells that run in Windows do not like these
    characters to be escaped.  One such shell is MSYS, a shell that comes
    with mingw.
    
    MSYS can be detected by the presence of the `MSYSTEM` environment
    variable.  If this is set, then don't escape curly braces.
---
 util/util.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/util.go b/util/util.go
index d687923..af2ef38 100644
--- a/util/util.go
+++ b/util/util.go
@@ -262,9 +262,9 @@ func Init(logLevel log.Level, logFile string, verbosity int) error {
 	return nil
 }
 
-// Escapes special characters for Windows builds.
+// Escapes special characters for Windows builds (not in an MSYS environment).
 func fixupCmdArgs(args []string) {
-	if runtime.GOOS == "windows" {
+	if runtime.GOOS == "windows" && os.Getenv("MSYSTEM") == "" {
 		for i, _ := range args {
 			args[i] = strings.Replace(args[i], "{", "\\{", -1)
 			args[i] = strings.Replace(args[i], "}", "\\}", -1)