diff options
| author | OpportunityLiu <[email protected]> | 2019-07-18 18:18:58 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-19 11:48:33 +0800 |
| commit | a8cc8e8989fd52574088200c5d6bbc3a4582d911 (patch) | |
| tree | 1f437f64fddee3bda885b656f15ae0909f0cdf5e | |
| parent | 8ef441ef5507b58e024c55e3f1d6b80284bef4d6 (diff) | |
fix
| -rw-r--r-- | xmake/core/base/os.lua | 2 | ||||
| -rw-r--r-- | xmake/core/base/path.lua | 7 | ||||
| -rw-r--r-- | xmake/plugins/project/vsxmake/getinfo.lua | 25 |
3 files changed, 17 insertions, 17 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 617b0ee52..4c23ed0c4 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -950,7 +950,7 @@ function os.setenv(name, ...) -- keep compatible with original implementation return os._setenv(name, values[1] or "") else - return os._setenv(path.joinenv(values)) + return os._setenv(name, path.joinenv(values)) end end diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua index d15c42fc4..8b35a771c 100644 --- a/xmake/core/base/path.lua +++ b/xmake/core/base/path.lua @@ -163,10 +163,11 @@ end function path.joinenv(env_table) -- check - env_table = env_table or {} + if not env_table or #env_table == 0 then + return "" + end local envsep = path.envsep() - if xmake._HOST == "windows" then local tab = {} for _, v in ipairs(env_table) do @@ -181,8 +182,6 @@ function path.joinenv(env_table) else return table.concat(env_table, envsep) end - - return result end -- the last character is the path seperator? diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index ad05c4788..b012ffff0 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -38,18 +38,19 @@ function _escape(str) end local map = - { ["%"] = "%25" -- Referencing metadata - ,["$"] = "%24" -- Referencing properties - ,["@"] = "%40" -- Referencing item lists - ,["'"] = "%27" -- Conditions and other expressions - ,[";"] = "%3B" -- List separator - ,["?"] = "%3F" -- Wildcard character for file names in Include and Exclude attributes - ,["*"] = "%2A" -- Wildcard character for use in file names in Include and Exclude attributes - -- html entities - ,["\""] = """ - ,["<"] = "<" - ,[">"] = ">" - ,["&"] = "&" + { + ["%"] = "%25" -- Referencing metadata + , ["$"] = "%24" -- Referencing properties + , ["@"] = "%40" -- Referencing item lists + , ["'"] = "%27" -- Conditions and other expressions + , [";"] = "%3B" -- List separator + , ["?"] = "%3F" -- Wildcard character for file names in Include and Exclude attributes + , ["*"] = "%2A" -- Wildcard character for use in file names in Include and Exclude attributes + -- html entities + , ["\""] = """ + , ["<"] = "<" + , [">"] = ">" + , ["&"] = "&" } return (string.gsub(str, "[%%%$@';%?%*\"<>&]", function (c) return assert(map[c]) end)) |
