summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-28 14:27:25 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-28 14:27:25 +0000
commit4c7469778a16c5ce575355440ccca10fdcd8d5dc (patch)
tree791e7241a21f3582dd50cba8b9bb86a749e868ac /Completion
parent04bf39bf2eb70bc3284459407c56196da02f280c (diff)
downloadzsh-4c7469778a16c5ce575355440ccca10fdcd8d5dc.tar.gz
zsh-4c7469778a16c5ce575355440ccca10fdcd8d5dc.tar.xz
zsh-4c7469778a16c5ce575355440ccca10fdcd8d5dc.zip
make _complete return the right value (12109)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Core/_complete19
1 files changed, 9 insertions, 10 deletions
diff --git a/Completion/Core/_complete b/Completion/Core/_complete
index 83b918135..c8c7b3d96 100644
--- a/Completion/Core/_complete
+++ b/Completion/Core/_complete
@@ -4,7 +4,7 @@
 # a normal completion function, but as one possible value for the
 # completer style.
 
-local comp name oldcontext
+local comp name oldcontext ret=1
 typeset -T curcontext="$curcontext" ccarray
 
 oldcontext="$curcontext"
@@ -25,11 +25,10 @@ fi
 comp="$_comps[-first-]"
 if [[ ! -z "$comp" ]]; then
   ccarray[3]=-first-
-  "$comp"
+  "$comp" && ret=0
   if [[ "$_compskip" = all ]]; then
-    _compskip=''
-    (( compstate[nmatches] ))
-    return
+    _compskip=
+    return ret
   fi
 fi
 
@@ -42,7 +41,7 @@ fi
 
 if [[ "$compstate[context]" = command ]]; then
   curcontext="$oldcontext"
-  _normal -s
+  _normal -s && ret=0
 else
   # Let's see if we have a special completion definition for the other
   # possible contexts.
@@ -57,14 +56,14 @@ else
 
   if [[ -z "$comp" ]]; then
     if [[ "$_compskip" = *default* ]]; then
-      _compskip=''
+      _compskip=
       return 1
     fi
     comp="$_comps[-default-]"
   fi
-  [[ -z "$comp" ]] || "$comp"
+  [[ -z "$comp" ]] || "$comp" && ret=0
 fi
 
-_compskip=''
+_compskip=
 
-(( compstate[nmatches] ))
+return ret