From d1dd3e441f35a2f54b699e7a3a1874a4788f8ed5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 26 Sep 2022 15:17:57 -0700 Subject: [PATCH] fix support for absolute paths in Windows --- file.lua | 1 + source_file.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/file.lua b/file.lua index 72c114a..2140bb1 100644 --- a/file.lua +++ b/file.lua @@ -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 diff --git a/source_file.lua b/source_file.lua index 54624b9..194ef9b 100644 --- a/source_file.lua +++ b/source_file.lua @@ -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