summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/sandbox/modules/string.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/core/sandbox/modules/string.lua b/xmake/core/sandbox/modules/string.lua
index 69ddbb723..6a7a455d7 100644
--- a/xmake/core/sandbox/modules/string.lua
+++ b/xmake/core/sandbox/modules/string.lua
@@ -44,6 +44,9 @@ function sandbox_string.vformat(format, ...)
local instance = sandbox.instance()
assert(instance)
+ -- ignore %$(...)
+ format = format:gsub("%%%$", "__$__")
+
-- format string
local result = string.format(format, ...)
assert(result)
@@ -54,6 +57,9 @@ function sandbox_string.vformat(format, ...)
result = filter:handle(result)
end
+ -- escape to $(...)
+ result = result:gsub("__%$__", "$")
+
-- ok?
return result
end