summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Thapaliya <nthapaliya@users.noreply.github.com>2016-10-12 11:18:03 -0600
committerNiraj Thapaliya <nthapaliya@users.noreply.github.com>2016-10-13 09:52:49 -0600
commit93e0a6a9deaf76f59b74f0f60d6a628dd21ced3d (patch)
tree49b71e7bc0c8fa67a30c7b87d805fb27118b3063
parent053af9a1c8db1c0cc9236da305d07bf382f8e7ab (diff)
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
-rw-r--r--shell/completion.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/completion.zsh b/shell/completion.zsh
index cef8afaf..cc2ac9c1 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -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='.'