Skip to content
Snippets Groups Projects
Commit 93e0a6a9 authored by Niraj Thapaliya's avatar Niraj Thapaliya
Browse files

Gnu `[` evaluates both sides of a -o condition regardless

It doesn't short circuit like we expect, causing trouble when $dir is
empty

Use shell builtin instead
parent 053af9a1
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ __fzf_generic_path_completion() {
setopt localoptions nonomatch
dir="$base"
while [ 1 ]; do
if [ -z "$dir" -o -d ${~dir} ]; then
if [[ -z "$dir" || -d ${~dir} ]]; then
leftover=${base/#"$dir"}
leftover=${leftover/#\/}
[ -z "$dir" ] && dir='.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment