From 3651e7bb69d298f12cd57c91b4a214d6619ff565 Mon Sep 17 00:00:00 2001 From: Pierre Macherel Date: Wed, 17 Apr 2024 18:09:10 +0200 Subject: [PATCH] Fix ~/HOME path In Windows OS, `~` may appear inside a path (not at the beginning). So only replace `~` by `$HOME` if `~` is at the very beginning of the path More consistent with the `string.gsub` on next line. --- lua/sqlite/utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/sqlite/utils.lua b/lua/sqlite/utils.lua index 90ba5efc..43c7067f 100644 --- a/lua/sqlite/utils.lua +++ b/lua/sqlite/utils.lua @@ -100,7 +100,7 @@ end)() M.expand = function(path) local expanded - if string.find(path, "~") then + if string.find(path, "^~") then expanded = string.gsub(path, "^~", os.getenv "HOME") elseif string.find(path, "^%.") then expanded = luv.fs_realpath(path)