about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/User/_man9
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b0fd7ff4..756af9438 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-07-19  Peter Stephenson  <pws@cambridgesiliconradio.com>
+
+	* 12308: Completion/User/_man: Andrej and pws: cope with systems
+	where manual pages just have bare .Z and no number; don't be
+	too clever about suffix until we try to strip it.
+
 2000-07-18  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 12297: Src/Zle/compcore.c: don't let duplicate matches keep us
diff --git a/Completion/User/_man b/Completion/User/_man
index 68ec12679..2dae425ee 100644
--- a/Completion/User/_man
+++ b/Completion/User/_man
@@ -30,13 +30,16 @@ fi
 mrd=(${^manpath/\%L/${LANG:-En_US.ASCII}}/mandb(N))
 if [[ $words[2] = (<->*|1M|l|n) ]]; then
   rep=(
-  $manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) )
+  $manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.*(N:t) )
   (($#mrd)) && rep[$#rep+1]=($(awk "\$2 == \"$words[2]\" {print \$1}" $mrd))
 else
-  rep=( $manpath/(sman|man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) )
+  rep=( $manpath/(sman|man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.*(N:t) )
   (($#mrd)) && rep[$#rep+1]=($(awk '{print $1}' $mrd))
 fi
 
 
+# Remove any compression suffix, then remove the minimum possible string
+# beginning with .<->: that handles problem cases like files called
+# `POSIX.1.5'.
 (( $#rep )) && _wanted manuals expl 'manual page' \
-    compadd - ${rep%%.[^.]##(.gz|.bz2|)}
+    compadd - ${${rep%%.(bz2|z|gz|Z)}%.<->*}