summaryrefslogtreecommitdiff
path: root/xmake/core/base/serialize.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-01-17 22:15:32 +0800
committerGitHub <[email protected]>2020-01-17 22:15:32 +0800
commita859e101ee88ec25fd948a08d2a02e7621241e7f (patch)
treeb6558e583ac20627222139a28f2c9c87c3af3c19 /xmake/core/base/serialize.lua
parentffce1ede94e7873e7ab248b05d468e84f6c205d0 (diff)
parentdc25ac7a87256a0470f523017ee790b29e9b6f2d (diff)
Merge pull request #667 from OpportunityLiu/options
Improve to parse command line options
Diffstat (limited to 'xmake/core/base/serialize.lua')
-rw-r--r--xmake/core/base/serialize.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/base/serialize.lua b/xmake/core/base/serialize.lua
index 6095fea9a..331e124a0 100644
--- a/xmake/core/base/serialize.lua
+++ b/xmake/core/base/serialize.lua
@@ -41,7 +41,11 @@ function serialize._keywords()
end
function serialize._makestring(str, opt)
- return string.format("%q", str)
+ if string.find(str, "\\", 1, true) and not string.find(str, "[%c%]%\n]") then
+ return string.format("[[%s]]", str)
+ else
+ return string.format("%q", str)
+ end
end
function serialize._makedefault(val, opt)