From 3cc4cd1adab62411f5666f71c1df13d45c4c1557 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Tue, 7 Sep 2021 05:09:26 -0700 Subject: [PATCH] Fix error when opening root directory --- data/core/common.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/core/common.lua b/data/core/common.lua index 3093a36d..9f3102bb 100644 --- a/data/core/common.lua +++ b/data/core/common.lua @@ -276,6 +276,7 @@ end function common.normalize_path(filename) + if not filename then return end if PATHSEP == '\\' then filename = filename:gsub('[/\\]', '\\') local drive, rem = filename:match('^([a-zA-Z])(:.*)') @@ -290,7 +291,8 @@ function common.normalize_path(filename) table.insert(accu, part) end end - return table.concat(accu, PATHSEP) + local npath = table.concat(accu, PATHSEP) + return npath == "" and PATHSEP or npath end