properly escape defines.

This commit is contained in:
Tom van Dijck 2016-05-02 10:18:36 -07:00
parent 921be76b06
commit 1dbc1ea784
3 changed files with 4 additions and 3 deletions

View File

@ -35,7 +35,7 @@ project "curl-lib"
end end
end end
if ca then if ca then
defines { "CURL_CA_BUNDLE=\\\"" .. ca .. "\\\"" } defines { 'CURL_CA_BUNDLE="' .. ca .. '"' }
end end
end end

View File

@ -89,6 +89,7 @@
function make.esc(value) function make.esc(value)
result = value:gsub("\\", "\\\\") result = value:gsub("\\", "\\\\")
result = result:gsub("\"", "\\\"")
result = result:gsub(" ", "\\ ") result = result:gsub(" ", "\\ ")
result = result:gsub("%(", "\\(") result = result:gsub("%(", "\\(")
result = result:gsub("%)", "\\)") result = result:gsub("%)", "\\)")

View File

@ -136,7 +136,7 @@
function gcc.getdefines(defines) function gcc.getdefines(defines)
local result = {} local result = {}
for _, define in ipairs(defines) do for _, define in ipairs(defines) do
table.insert(result, '-D' .. define) table.insert(result, '-D' .. p.esc(define))
end end
return result return result
end end
@ -144,7 +144,7 @@
function gcc.getundefines(undefines) function gcc.getundefines(undefines)
local result = {} local result = {}
for _, undefine in ipairs(undefines) do for _, undefine in ipairs(undefines) do
table.insert(result, '-U' .. undefine) table.insert(result, '-U' .. p.esc(undefine))
end end
return result return result
end end