Fail when files arg is empty, and stop on root

This commit is contained in:
Hans Larsen 2022-01-31 10:44:28 -08:00
parent cee1edb460
commit ad34c47f09

View File

@ -899,7 +899,8 @@ function __bobthefish_prompt_find_file_up -S -d 'Find file(s), going up the pare
set -l dir "$argv[1]" set -l dir "$argv[1]"
set -l files $argv[2..] set -l files $argv[2..]
if [ -z "$dir" ] if test -z "$dir"
or test -z "$files"
return 1 return 1
end end
@ -910,6 +911,9 @@ function __bobthefish_prompt_find_file_up -S -d 'Find file(s), going up the pare
end end
end end
[ "$dir" = '/' ]
and return 1
set dir (__bobthefish_dirname "$dir") set dir (__bobthefish_dirname "$dir")
end end
return 1 return 1