View | Details | Raw Unified | Return to bug 161475
Collapse All | Expand All

(-)usr.bin/man/man.sh (-2 / +8 lines)
Lines 404-411 man_find_and_display() { Link Here
404
	local found_page locpath p path sect
404
	local found_page locpath p path sect
405
405
406
	# Check to see if it's a file. But only if it has a '/' in
406
	# Check to see if it's a file. But only if it has a '/' in
407
	# the filename.
407
	# the filename or looks like a manpage.
408
	case "$1" in
408
	case "$1" in
409
	*.[0-9ln]*) ;& # fallthrough
409
	*/*)	if [ -f "$1" -a -r "$1" ]; then
410
	*/*)	if [ -f "$1" -a -r "$1" ]; then
410
			decho "Found a usable page, displaying that"
411
			decho "Found a usable page, displaying that"
411
			unset use_cat
412
			unset use_cat
Lines 898-909 do_apropos() { Link Here
898
899
899
do_man() {
900
do_man() {
900
	man_parse_args "$@"
901
	man_parse_args "$@"
901
	if [ -z "$pages" ]; then
902
	if [ -z "$pages" -a -t 0 ]; then
902
		echo 'What manual page do you want?' >&2
903
		echo 'What manual page do you want?' >&2
903
		exit 1
904
		exit 1
904
	fi
905
	fi
905
	man_setup
906
	man_setup
906
907
908
	if [ ! -t 0 ]; then
909
	    decho "Displaying from stdin"
910
	    man_display_page
911
	fi
912
907
	for page in $pages; do
913
	for page in $pages; do
908
		decho "Searching for $page"
914
		decho "Searching for $page"
909
		man_find_and_display "$page"
915
		man_find_and_display "$page"

Return to bug 161475