about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_man5
1 files changed, 3 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index 89c481239..a3a4d4796 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -25,9 +25,10 @@ _man() {
   (( $#_manpath )) ||
       _manpath=( /usr/man(-/) /(opt|usr)/(pkg|dt|share|X11R6|local)/(cat|)man(-/) )
 
-  if (( $words[(I)-M] )); then
+  integer index=$words[(I)-M]
+  if (( index )); then
     local opt
-    opt=$words[(( $words[(I)-M]+1 ))]
+    opt=$words[index+1]
     _manpath=($_manpath $opt)
   fi