path.join shold unquot each element and quot result
For example:
IPPARCH="ia32"
IPPBASE=J([[e:\Program Files\Intel\IPP\6.0.2.074]], IPPARCH)
-- here i have IPPBASE= [["e:\Program Files\Intel\IPP\6.0.2.074\ia32"]]
....
incdir=J(IPPBASE, 'include')
-- here i have incdir= [["e:\Program Files\Intel\IPP\6.0.2.074\ia32\include"]]
to support this i implement:
function trim(s) return(s:gsub('^%s+',''):gsub('%s+$','')) end
function path_unquoted(s)
s = trim(s)
if s:sub(1,1) == '"' and s:sub(-1,-1) == '"' then
return (s:sub(2,-2))
end
return s
end
function path_quoted(s)
if s:find("%s") then return '"' .. s .. '"' end
return s
end
function J(...)
local t,n = {...}, select('#', ...)
local r = path_unquoted(t[1])
for i = 2, #t do r = path.join(r,path_unquoted(t[i])) end
return path_quoted(r)
end
path.join shold unquot each element and quot result
For example:
IPPARCH="ia32" IPPBASE=J([[e:\Program Files\Intel\IPP\6.0.2.074]], IPPARCH) -- here i have IPPBASE= [["e:\Program Files\Intel\IPP\6.0.2.074\ia32"]] .... incdir=J(IPPBASE, 'include') -- here i have incdir= [["e:\Program Files\Intel\IPP\6.0.2.074\ia32\include"]]
to support this i implement: