Permalink
Browse files

Compare header_base case-insensitive, so that screwed-up Windows path…

…s will still be stripped properly.
  • Loading branch information...
timmensch
timmensch committed Apr 18, 2012
1 parent ba86348 commit c7fffb6330d6e0c22767b64aec372dac2be6b859
Showing with 12 additions and 2 deletions.
  1. +12 −2 lib/dub/LuaBinder.lua
View
@@ -534,11 +534,21 @@ end
function lib:header(header)
local base=self.header_base
if type(base)=='string' then
- return string.gsub(header, self.header_base .. '/', '')
+ -- on Windows, case can be messed up
+ local s,e = string.find( header:lower(), self.header_base:lower()..'/' )
+ if e then
+ header=header:sub(e+1)
+ end
+
+ return header
else
local stripped = header
for _,b in ipairs(base) do
- stripped=string.gsub(stripped,b.."/",'')
+ -- on Windows, case can be messed up
+ local s,e = string.find( stripped:lower(), b:lower()..'/' )
+ if e then
+ stripped=stripped:sub(e+1)
+ end
end
return stripped
end

0 comments on commit c7fffb6

Please sign in to comment.