summaryrefslogtreecommitdiffstats
path: root/Completion/Unix
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 /Completion/Unix
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
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_man7
1 files changed, 5 insertions, 2 deletions
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