Up to [cvsweb.bsd.lv] / mandoc
Request diff between arbitrary revisions
Default branch: MAIN
Revision 1.4 / (download) - annotate - [select for diffs], Wed Apr 13 20:26:19 2022 UTC (2 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +4 -2 lines
Diff to previous 1.3 (unified)
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.3 / (download) - annotate - [select for diffs], Fri Dec 14 06:33:14 2018 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6,
VERSION_1_14_5
Changes since 1.2: +2 -4 lines
Diff to previous 1.2 (unified)
Cleanup, no functional change: Now that message handling is properly encapsulated, remove struct mparse pointers from four structs (roff, roff_man, tbl_node, eqn_node) and from the argument lists of five functions (roff_alloc, roff_man_alloc, mandoc_getarg, tbl_alloc, eqn_alloc). Except for being passed to the main program as an opaque object, it now only occurs in read.c, as it should, and not across 15 files like in the past.
Revision 1.2 / (download) - annotate - [select for diffs], Thu Dec 13 05:23:38 2018 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.1: +3 -2 lines
Diff to previous 1.1 (unified)
Cleanup, no functional change: No need to expose the eqn(7) syntax tree data structures everywhere. Move them to their own include file, "eqn.h". While here, delete the unused enum eqn_pilet.
Revision 1.1 / (download) - annotate - [select for diffs], Thu Dec 13 03:40:13 2018 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Cleanup, no functional change: In libroff.h, nothing was left except the eqn(7) parser interface, which isn't really part of the roff(7) parser, so rename it to eqn_parse.h. While here, move struct eqn_def to eqn.c because that's the only file using it, and let eqn_box_free() and eqn_free() handle NULL.