summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2025-08-28 09:15:08 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2025-08-28 09:15:08 +0900
commit7d4fc84519ad5ad5e12c7d0a3eddb02d920e6707 (patch)
tree332e0c4b6f93309ee12fcdc8bea63c5c0cab52dc
parentunposted: Test release: zsh-5.9.0.3-test. (diff)
downloadzsh-7d4fc84519ad5ad5e12c7d0a3eddb02d920e6707.tar
zsh-7d4fc84519ad5ad5e12c7d0a3eddb02d920e6707.tar.gz
zsh-7d4fc84519ad5ad5e12c7d0a3eddb02d920e6707.tar.bz2
zsh-7d4fc84519ad5ad5e12c7d0a3eddb02d920e6707.tar.lz
zsh-7d4fc84519ad5ad5e12c7d0a3eddb02d920e6707.tar.xz
zsh-7d4fc84519ad5ad5e12c7d0a3eddb02d920e6707.tar.zst
zsh-7d4fc84519ad5ad5e12c7d0a3eddb02d920e6707.zip
53866: fix _man for NetBSD
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_man7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e56d4ecb..db8faad72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,11 @@
+2025-08-28 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+
+ * 53866: Completion/Unix/Command/_man: fix _man for NetBSD
+
2025-08-24 Eric Cook <llua@gmx.com>
* unposted: Config/version.mk: Test release: zsh-5.9.0.3-test.
-
2025-08-16 dana <dana@dana.is>
* 53808: Doc/Zsh/expn.yo: clarify Yn globqual explanation
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index 2869e99e2..28bc12fe7 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -169,9 +169,12 @@ _man() {
typeset -gHA _manpath_cache
fi
if [[ -z $_manpath_cache[$MANPATH] ]]; then
- local mp
+ local -aU mp
if [[ $variant == netbsd* ]]; then
- mp=( ${(s.:.)$(command man -p 2>/dev/null)} )
+ # 'man -p' gives a newline-separatd list of
+ # /usr/pkg/man/man1 /usr/share/man/man8/amd64 etc.
+ # Here we just remove the trailing /man1 or /man8/amd64 etc.
+ mp=( ${${(f)"$(command man -p 2>/dev/null)"}%%/man/*}/man )
elif [[ $variant != freebsd* ]]; then
mp=( ${(s.:.)$(command man -w 2>/dev/null)} )
fi