man: also attempt to interpret argument as path

This commit is contained in:
Jacob Moody 2024-06-11 02:26:47 +00:00
parent 0dc37f9794
commit 71d676a12f

View file

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