git: 147ab264373a - stable/13 - do not expect mandoc(1) to terminate in finite time

From: Wolfram Schneider <wosch_at_FreeBSD.org>
Date: Mon, 12 Feb 2024 15:23:50 UTC
The branch stable/13 has been updated by wosch:

URL: https://cgit.FreeBSD.org/src/commit/?id=147ab264373a61eea9f6bd9ffd06b399a186f7ef

commit 147ab264373a61eea9f6bd9ffd06b399a186f7ef
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2022-12-27 17:04:04 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-02-12 15:22:55 +0000

    do not expect mandoc(1) to terminate in finite time
    
    PR:             266868
    (cherry picked from commit 433c5a8ae42f0487cfe860af1d291ec3c7d009f7)
---
 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 114ea9d7a0b2..1d9eb423b707 100755
--- a/usr.bin/man/man.sh
+++ b/usr.bin/man/man.sh
@@ -27,6 +27,12 @@
 #  SUCH DAMAGE.
 #
 
+# 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.