Skip to content

Commit 019b2af

Browse files
author
skywind3000
committed
add a return statement for nil case in os.interpreter() function.
1 parent ef9a49d commit 019b2af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

z.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- z.lua - a cd command that learns, by skywind 2018-2022
55
-- Licensed under MIT license.
66
--
7-
-- Version 1.8.18, Last Modified: 2024/03/20 22:17
7+
-- Version 1.8.18, Last Modified: 2024/04/07 11:24
88
--
99
-- * 10x faster than fasd and autojump, 3x faster than z.sh
1010
-- * available for posix shells: bash, zsh, sh, ash, dash, busybox
@@ -883,6 +883,7 @@ function os.interpreter()
883883
local lua = os.argv[-1]
884884
if lua == nil then
885885
io.stderr:write("cannot get executable name, recompiled your lua\n")
886+
return nil
886887
end
887888
if os.path.single(lua) then
888889
local path = os.path.which(lua)

0 commit comments

Comments
 (0)