man(1) needs to check for .so files not only in the first line

PR: 279182

Some manual pages have a copyright notice or commit id before including
other files with the .so macro. We need to skip comments and empty lines
at the beginning of the manpage while checking for the first .so macro.

MFC after:	1 week
This commit is contained in:
Wolfram Schneider 2024-05-26 05:48:40 +00:00
parent cadd2ca217
commit 73eb53813f

View File

@ -322,7 +322,7 @@ man_check_for_so() {
# We need to loop to accommodate multiple .so directives.
while true
do
line=$($cattool "$manpage" 2>/dev/null | head -n1)
line=$($cattool "$manpage" 2>/dev/null | grep -E -m1 -v '^\.\\"[ ]*|^[ ]*$')
case "$line" in
.so*) trim "${line#.so}"
decho "$manpage includes $tstr"