Subject: [patch] _man: Support directories with suffixes
From: Matthew Martin <[email-masked]>
To: [email-masked]
Date: Thu, 19 May 2016 00:07:25 -0500
List-Id: Zsh Workers List <zsh-workers.zsh.org>

896f43c broke completion for man 3p <tab> on OpenBSD because those man
pages are in /usr/share/man/man3p.

I couldn't figure out what was the purpose for using $~sect, so I just
dropped the tilde.

diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index 0534db7..9aec833 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -52,7 +52,7 @@ _man() {
   fi
 
   if [[ $sect = (<->*|1M|l|n) || $sect = \(*\|*\) ]]; then
-    dirs=( $^_manpath/(sman|man|cat)${~sect%%[^0-9]#}/ )
+    dirs=( $^_manpath/(sman|man|cat)($sect|${sect%%[^0-9]#})/ )
     awk="\$2 == \"$sect\" {print \$1}"
   else
     dirs=( $^_manpath/(sman|man|cat)*/ )