shithub: front

Download patch

ref: 71d676a12ff86453491ab36c62835d5443903f68
parent: 0dc37f9794c63827005b67a39a8ad749e138eda9
author: Jacob Moody <moody@posixcafe.org>
date: Mon Jun 10 22:26:47 EDT 2024

man: also attempt to interpret argument as path

--- a/rc/bin/man
+++ b/rc/bin/man
@@ -84,7 +84,6 @@
 if(~ $#sec 0) {
 	sec=`{ls -pd $S/[0-9]* }
 }
-ix=$S/$sec/INDEX
 if(~ $#* 1) pat='^'^$1^' '
 if not pat='^('^`{echo $* | sed 's/ /|/g'}^') '
 fils=()
@@ -101,7 +100,9 @@
 	# nothing in INDEX. try for file of given name
 	for(i) {
 		if(~ $i intro) i=0intro
-		for(n in $sec) {
+		if (/bin/test -f $i)
+			fils=($fils $i)
+		if not for(n in $sec) {
 			try=`{echo $S/$n/$i | tr A-Z a-z}
 			if (/bin/test -f $try)
 				fils=($fils $try)
--