summaryrefslogtreecommitdiffstats
path: root/usr.bin/man
diff options
context:
space:
mode:
authorgordon <gordon@FreeBSD.org>2010-10-06 07:22:56 +0000
committergordon <gordon@FreeBSD.org>2010-10-06 07:22:56 +0000
commit77748dfb9cdb50d669f1b1349c8f46e1fe49d96b (patch)
tree8d4df250a4a77c3a5c78117685cf4859e05f1e6c /usr.bin/man
parent6af162923c22a913499ec87645671c5e83da59d0 (diff)
downloadFreeBSD-src-77748dfb9cdb50d669f1b1349c8f46e1fe49d96b.zip
FreeBSD-src-77748dfb9cdb50d669f1b1349c8f46e1fe49d96b.tar.gz
If LANG/LC_CTYPE/LC_ALL is set and the localized man page contains a page
also in the base set, the man utility when invoked with -a would display pages for each locale in the same tree: $ LANG=en_GB.ISO8859-15 man -wa man /usr/share/man/en.ISO8859-15/man1/man.1.gz /usr/share/man/man1/man.1.gz /usr/share/man/en.ISO8859-15/man7/man.7.gz /usr/share/man/man7/man.7.gz Use continue to break out of the loop for the current locale. This results in behavior more closely matching the old GNU man implementation: $ LANG=en_GB.ISO8859-15 man -wa man /usr/share/man/en.ISO8859-15/man1/man.1.gz /usr/share/man/en.ISO8859-15/man7/man.7.gz This will still search for a copy of the file in other manual path locations. If there was a /usr/local/man/man1/man.1.gz file, it would still be displayed. This is also consistent with the GNU man implementation. Submitted by: arundel Approved by: wes (mentor implicit)
Diffstat (limited to 'usr.bin/man')
-rwxr-xr-xusr.bin/man/man.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh
index a008029..cca7638 100755
--- a/usr.bin/man/man.sh
+++ b/usr.bin/man/man.sh
@@ -368,7 +368,9 @@ man_find_and_display() {
if find_file $p $sect $MACHINE "$1"; then
found_page=yes
man_display_page
- if [ -z "$aflag" ]; then
+ if [ -n "$aflag" ]; then
+ continue 2
+ else
return
fi
fi
@@ -378,7 +380,9 @@ man_find_and_display() {
if find_file $p $sect $MACHINE_ARCH "$1"; then
found_page=yes
man_display_page
- if [ -z "$aflag" ]; then
+ if [ -n "$aflag" ]; then
+ continue 2
+ else
return
fi
fi
@@ -387,7 +391,9 @@ man_find_and_display() {
if find_file $p $sect '' "$1"; then
found_page=yes
man_display_page
- if [ -z "$aflag" ]; then
+ if [ -n "$aflag" ]; then
+ continue 2
+ else
return
fi
fi
OpenPOWER on IntegriCloud