Skip to content

Commit ed80631

Browse files
committed
fix: only replace path with env var if value defined, otherwise leave $ character in the path
1 parent 4516612 commit ed80631

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/diffview/path.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ function PathLib:expand(path)
295295

296296
for i = idx, #segments do
297297
local env_var = segments[i]:match("^%$(%S+)$")
298-
if env_var then
299-
segments[i] = uv.os_getenv(env_var) or env_var
298+
if env_var and uv.os_getenv(env_var) ~= nil then
299+
segments[i] = uv.os_getenv(env_var)
300300
end
301301
end
302302

0 commit comments

Comments
 (0)