fix support for absolute paths in Windows
This commit is contained in:
parent
d1d05fe5c9
commit
d1dd3e441f
1
file.lua
1
file.lua
|
@ -187,6 +187,7 @@ function is_absolute_path(path)
|
||||||
-- POSIX systems permit backslashes in filenames
|
-- POSIX systems permit backslashes in filenames
|
||||||
return path:sub(1,1) == '/'
|
return path:sub(1,1) == '/'
|
||||||
elseif os_path_separator == '\\' then
|
elseif os_path_separator == '\\' then
|
||||||
|
if path:sub(2,2) == ':' then return true end -- DOS drive letter followed by volume separator
|
||||||
local f = path:sub(1,1)
|
local f = path:sub(1,1)
|
||||||
return f == '/' or f == '\\'
|
return f == '/' or f == '\\'
|
||||||
else
|
else
|
||||||
|
|
|
@ -206,6 +206,7 @@ function is_absolute_path(path)
|
||||||
-- POSIX systems permit backslashes in filenames
|
-- POSIX systems permit backslashes in filenames
|
||||||
return path:sub(1,1) == '/'
|
return path:sub(1,1) == '/'
|
||||||
elseif os_path_separator == '\\' then
|
elseif os_path_separator == '\\' then
|
||||||
|
if path:sub(2,2) == ':' then return true end -- DOS drive letter followed by volume separator
|
||||||
local f = path:sub(1,1)
|
local f = path:sub(1,1)
|
||||||
return f == '/' or f == '\\'
|
return f == '/' or f == '\\'
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue