summaryrefslogtreecommitdiff
path: root/xmake/core/base/string.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-11 22:57:43 +0800
committerruki <[email protected]>2019-03-11 11:46:24 +0800
commit6e4c9f31810a9b5053b2d0b72056fd5552bcd8b4 (patch)
treee7240807f555fd8412823b69d76afe3387e7eb49 /xmake/core/base/string.lua
parente6b992ae11a7a2fce3239e4e35b19240eff3ccf7 (diff)
save package manifest
Diffstat (limited to 'xmake/core/base/string.lua')
-rw-r--r--xmake/core/base/string.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/core/base/string.lua b/xmake/core/base/string.lua
index c3f3958d5..cf6f7b124 100644
--- a/xmake/core/base/string.lua
+++ b/xmake/core/base/string.lua
@@ -43,7 +43,9 @@ function string._makestr(object, deflate, serialize, level)
if deflate then
s = s .. "{"
else
- s = s .. "\n"
+ if level > 0 then
+ s = s .. "\n"
+ end
for l = 1, level do
s = s .. " "
end
@@ -69,7 +71,7 @@ function string._makestr(object, deflate, serialize, level)
-- make key = value
if type(k) == "string" then
- if serialize then
+ if serialize and not k:match("^%a[%w_]+$") then
k = string.format("[%q]", k)
end
if deflate then