From 73eb53813fe3a2245edbeb670902e4bb9d41e288 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Sun, 26 May 2024 05:48:40 +0000 Subject: [PATCH] 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 --- usr.bin/man/man.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index af638527f49782..24a0464689cce3 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -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"