git: 433c5a8ae42f - main - do not expect mandoc(1) to terminate in finite time

From: Wolfram Schneider <wosch_at_FreeBSD.org>
Date: Tue, 27 Dec 2022 17:16:26 UTC
The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/src/commit/?id=433c5a8ae42f0487cfe860af1d291ec3c7d009f7

commit 433c5a8ae42f0487cfe860af1d291ec3c7d009f7
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2022-12-27 17:04:04 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2022-12-27 17:04:04 +0000

    do not expect mandoc(1) to terminate in finite time
    
    PR:             266868
---
 usr.bin/man/man.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh
index 2c2f1bf648de..3cb748c1ba8f 100755
--- a/usr.bin/man/man.sh
+++ b/usr.bin/man/man.sh
@@ -28,6 +28,12 @@
 #
 # $FreeBSD$
 
+# Rendering a manual page is fast. Even a manual page several 100k in size
+# takes less than a CPU second. If it takes much longer, it is very likely
+# that a tool like mandoc(1) is running in an infinite loop. In this case
+# it is better to terminate it.
+ulimit -t 20
+
 # 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.