aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>2024-05-26 05:48:40 +0000
committerWolfram Schneider <wosch@FreeBSD.org>2024-05-26 05:48:40 +0000
commit73eb53813fe3a2245edbeb670902e4bb9d41e288 (patch)
tree1666d52159df093604b08411d724868d1dff256a
parentcadd2ca21765ebcb95b77ec94977b4e74e1edc1b (diff)
downloadsrc-73eb53813fe3a2245edbeb670902e4bb9d41e288.tar.gz
src-73eb53813fe3a2245edbeb670902e4bb9d41e288.zip
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
-rwxr-xr-xusr.bin/man/man.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh
index af638527f497..24a0464689cc 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"