Up to [cvsweb.bsd.lv] / mandoc / regress / eqn / define
Request diff between arbitrary revisions
Default branch: MAIN
Current tag: MAIN
Revision 1.3 / (download) - annotate - [select for diffs], Wed Apr 13 20:26:20 2022 UTC (2 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +10 -2 lines
Diff to previous 1.2 (colored)
To prevent infinite recursion while expanding eqn(7) definitions, we must not reset the recursion counter when moving beyond the end of the *previous* expansion, but we may only do so when moving beyond the rightmost position reached by *any* expansion in the current equation. This matters because definitions can nest; consider: .EQ define inner "content" define outer "inner outer" outer .EN This endless loop was found by tb@ using afl(1). Incidentally, GNU eqn(1) also performs an infinite loop in this situation and then crashes when memory runs out, but that's not an excuse for nasty behaviour of mandoc(1). While here, consistently print the expanded content even when the expansion is finally truncated. While that is not likely to help end-users, it may help authors of eqn(7) code to understand what's going on. Besides, it sends a very clear signal that something is amiss, which was easy to miss in the past unless people enabled -W error or used -T lint.
Revision 1.2 / (download) - annotate - [select for diffs], Tue Jul 4 15:24:45 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6,
VERSION_1_14_5,
VERSION_1_14_4,
VERSION_1_14_3,
VERSION_1_14_2
Changes since 1.1: +3 -2 lines
Diff to previous 1.1 (colored)
Messages of the -Wbase level now print STYLE:. Since this causes horrible churn anyway, profit of the opportunity to stop excessive testing, such that this is hopefully the last instance of such churn. Consistently use OpenBSD RCS tags, blank .Os, blank fourth .TH argument, and Mdocdate like everywhere else. Use -Ios=OpenBSD for platform-independent predictable output.
Revision 1.1 / (download) - annotate - [select for diffs], Sat Mar 11 16:04:18 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
test infinite recursion in eqn(7) "define" statements