Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OpportunityLiu committed Jul 18, 2019
1 parent 5d0b2a6 commit fcfeac4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion xmake/core/base/os.lua
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions xmake/core/base/path.lua
Expand Up @@ -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
Expand All @@ -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?
Expand Down
25 changes: 13 additions & 12 deletions xmake/plugins/project/vsxmake/getinfo.lua
Expand Up @@ -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
,["\""] = """
,["<"] = "&lt;"
,[">"] = "&gt;"
,["&"] = "&amp;"
{
["%"] = "%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
, ["\""] = "&quot;"
, ["<"] = "&lt;"
, [">"] = "&gt;"
, ["&"] = "&amp;"
}

return (string.gsub(str, "[%%%$@';%?%*\"<>&]", function (c) return assert(map[c]) end))
Expand Down

0 comments on commit fcfeac4

Please sign in to comment.