Up to [cvsweb.bsd.lv] / mandoc
Request diff between arbitrary revisions
Default branch: MAIN
Current tag: HEAD
Revision 1.38 / (download) - annotate - [select for diffs], Tue Aug 13 12:44:00 2024 UTC (5 weeks, 5 days ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)
Fix a bug in .Ql handling that has been present since the beginning (2017). Since the .Ql macro action uses an output prefix of "'`" and an output suffix of "`'", md_post_raw() would decrement the code_blocks state variable even though md_pre_raw() had earlier neglected to increment it, hence leaving the variable in an invalid negative state. That in turn could result in corrupt output in a variety of ways. Fix this by checking in md_pre_raw() whether the prefix *contains* a backtick rather than only checking whether it *starts* with a backtick. For consistency, apply the same change to md_post_raw() even though there was no bug in that function: all *suffixes* containing a backtick actually contain it in the leading position. Thanks to job@ for reporting this bug. He noticed a particularly nasty kind of output corruption: having .Ql in an input file would result in ASCII_NBRSP (0x31) sneaking through into the output stream if later, unrelated parts of the same input file directly or indirectly used the \~ escape sequence, for example by using the .Ex macro.