From 7efe75fe7d2138598d173107989d381c43742d25 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Sun, 18 Feb 2024 21:31:24 +0000 Subject: [PATCH] More path fixes --- data/core/common.lua | 2 +- data/core/dirwatch.lua | 2 +- data/core/start.lua | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/core/common.lua b/data/core/common.lua index ed0d9e92..ac337b00 100644 --- a/data/core/common.lua +++ b/data/core/common.lua @@ -610,7 +610,7 @@ end ---@param path string ---@return boolean function common.is_absolute_path(path) - return path:sub(1, 1) == PATHSEP or path:match("^(%a):\\") or path:match('^(%w*):') + return path:sub(1, 1) == PATHSEP or path:match("^(%a):\\") or path:match('^([%w%s]*):') end diff --git a/data/core/dirwatch.lua b/data/core/dirwatch.lua index aa627006..2c5cf930 100644 --- a/data/core/dirwatch.lua +++ b/data/core/dirwatch.lua @@ -97,7 +97,7 @@ function dirwatch:check(change_callback, scan_time, wait_time) if self.monitor:mode() == "single" then local path = common.dirname(id) if not string.match(id, "^/") and not string.match(id, "^%a:[/\\]") then - path = common.dirname(common.basepath(self.single_watch_top) .. id) + path = common.dirname(self.single_watch_top .. PATHSEP .. id) end change_callback(path) elseif self.reverse_watched[id] then diff --git a/data/core/start.lua b/data/core/start.lua index a509f678..08470204 100644 --- a/data/core/start.lua +++ b/data/core/start.lua @@ -5,11 +5,11 @@ MOD_VERSION = "3" SCALE = tonumber(os.getenv("LITE_SCALE") or os.getenv("GDK_SCALE") or os.getenv("QT_SCALE_FACTOR")) or 1 PATHSEP = package.config:sub(1, 1) -EXEDIR = EXEFILE:match("^(.+)[:/\\][^/\\]+$") +EXEDIR = EXEFILE:match("^(.+)[/\\][^/\\]+$") if MACOS_RESOURCES then DATADIR = MACOS_RESOURCES else - local prefix = os.getenv('LITE_PREFIX') or EXEDIR:match("^(.+)[:/\\]bin$") + local prefix = os.getenv('LITE_PREFIX') or EXEDIR:match("^(.+)[/\\]bin$") DATADIR = prefix and (prefix .. PATHSEP .. 'share' .. PATHSEP .. 'lite-xl') or (EXEDIR .. PATHSEP .. 'data') end