Add common.is_absolute_path

This commit is contained in:
Guldoman
2022-06-01 04:42:50 +02:00
parent 13d062479a
commit 9a428648a9
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -385,6 +385,11 @@ function common.normalize_path(filename)
end
function common.is_absolute_path(path)
return path:sub(1, 1) == PATHSEP or path:match("^(%a):\\")
end
function common.path_belongs_to(filename, path)
return string.find(filename, path .. PATHSEP, 1, true) == 1
end