summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Command/_man5
2 files changed, 6 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 15fb38747..1a8d7d786 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
 2010-10-21  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
-	* Silas Silva: users/15464: Completion/Unix/Command/_man:
-	support for -M argument.
+	* Silas Silva (with minor improvement): users/15464:
+	Completion/Unix/Command/_man: support for -M argument.
 
 2010-10-18  Peter Stephenson  <pws@csr.com>
 
@@ -13773,5 +13773,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5110 $
+* $Revision: 1.5111 $
 *****************************************************
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