You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/06/25 07:48:08 UTC

[mynewt-newt] branch master updated: cmake: escape also '<' and '>'

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

jerzy 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 4a5cd61  cmake: escape also '<' and '>'
4a5cd61 is described below

commit 4a5cd613b596151f19fa7dc71b26cfe9c4b62c16
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Jun 24 15:03:59 2021 +0200

    cmake: escape also '<' and '>'
    
    cmake execute commands with sh so < and > also has to be escaped like " ( )
    This allows to have cflags in the form
    -DMBEDTLS_USER_CONFIG_FILE=<mbedtls/config_mynewt.h>
---
 newt/builder/cmake.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/newt/builder/cmake.go b/newt/builder/cmake.go
index c4092bc..7b4e0b3 100644
--- a/newt/builder/cmake.go
+++ b/newt/builder/cmake.go
@@ -69,6 +69,8 @@ func escapeFlags(flag string) string {
 	flag = strings.Replace(flag, "\"", "\\\\\\\"", -1)
 	flag = strings.Replace(flag, "(", "\\\\(", -1)
 	flag = strings.Replace(flag, ")", "\\\\)", -1)
+	flag = strings.Replace(flag, "<", "\\\\<", -1)
+	flag = strings.Replace(flag, ">", "\\\\>", -1)
 	return flag
 }