Skip to content

Commit

Permalink
man: do not ignore the exit status of roff tools
Browse files Browse the repository at this point in the history
PR:		223516
Approved by:	emaste, bapt
Differential Revision:	https://reviews.freebsd.org/D44798
  • Loading branch information
wosch committed Apr 20, 2024
1 parent 21ffadb commit 14a5c10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion usr.bin/man/man.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
# it is better to terminate it.
ulimit -t 20

# do not ignore the exit status of roff tools
set -o pipefail

# ignore SIGPIPE exits because pagers may exit before reading all their input.
trap '' SIGPIPE

# Usage: add_to_manpath path
# Adds a variable to manpath while ensuring we don't have duplicates.
# Returns true if we were able to add something. False otherwise.
Expand Down Expand Up @@ -312,7 +318,7 @@ man_check_for_so() {
# We need to loop to accommodate multiple .so directives.
while true
do
line=$($cattool "$manpage" | head -n1)
line=$($cattool "$manpage" 2>/dev/null | head -n1)
case "$line" in
.so*) trim "${line#.so}"
decho "$manpage includes $tstr"
Expand Down

0 comments on commit 14a5c10

Please sign in to comment.