]> git.cameronkatri.com Git - mandoc.git/commit
Put the code handling \} into a new function roff_cond_checkend()
authorIngo Schwarze <schwarze@openbsd.org>
Mon, 3 Aug 2020 11:02:57 +0000 (11:02 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Mon, 3 Aug 2020 11:02:57 +0000 (11:02 +0000)
commit16d4788cef7bb58fdc8820bdd5ecb511933f0d15
treebf3311df1f25ef3a44bb86fa7d6dfb9b27370aba
parent53d5687049e8bdb3b568febbdf4ed19da4e1a95f
Put the code handling \} into a new function roff_cond_checkend()
and call that function not only from both places where copies
existed - when processing text lines and when processing request/macro
lines in conditional block scope - but also when closing a macro
definition request, such that this construction works:

.if n \{.de macroname
macro content
.. \} ignored arguments
.macroname

This fixes a bug reported by John Gardner <gardnerjohng at gmail dot com>.

While here, avoid a confusing decrement of the line scope counter
in roffnode_cleanscope() for conditional blocks that do not have
line scope in the first place (no functional change for this part).
Also improve validation of an internal invariant in roff_cblock()
and polish some comments.
regress/roff/cond/Makefile
regress/roff/cond/close.in
regress/roff/cond/close.out_ascii
regress/roff/cond/close.out_lint
regress/roff/cond/de.in [new file with mode: 0644]
regress/roff/cond/de.out_ascii [new file with mode: 0644]
regress/roff/cond/de.out_lint [new file with mode: 0644]
roff.c