Fix problem with filenames missing normalization
This commit is contained in:
@@ -206,7 +206,9 @@ end
|
||||
function common.home_encode(text)
|
||||
if HOME and string.find(text, HOME, 1, true) == 1 then
|
||||
local dir_pos = #HOME + 1
|
||||
if string.find(text, PATHSEP, dir_pos, true) == dir_pos then
|
||||
-- ensure we don't replace if the text is just "$HOME" or "$HOME/" so
|
||||
-- it must have a "/" following the $HOME and some characters following.
|
||||
if string.find(text, PATHSEP, dir_pos, true) == dir_pos and #text > dir_pos then
|
||||
return "~" .. text:sub(dir_pos)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user