fix support for absolute paths in Windows

This commit is contained in:
Kartik K. Agaram 2022-09-26 15:17:57 -07:00
parent d1d05fe5c9
commit d1dd3e441f
2 changed files with 2 additions and 0 deletions

View File

@ -187,6 +187,7 @@ function is_absolute_path(path)
-- POSIX systems permit backslashes in filenames
return path:sub(1,1) == '/'
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)
return f == '/' or f == '\\'
else

View File

@ -206,6 +206,7 @@ function is_absolute_path(path)
-- POSIX systems permit backslashes in filenames
return path:sub(1,1) == '/'
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)
return f == '/' or f == '\\'
else