groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/07: src/roff/troff/input.cpp: Drop misleading comment.


From: G. Branden Robinson
Subject: [groff] 01/07: src/roff/troff/input.cpp: Drop misleading comment.
Date: Sun, 26 Jun 2022 09:23:59 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 555a7562eb3103029d1958c3d01a7d0e7ddeb2ac
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Jun 22 03:43:01 2022 -0500

    src/roff/troff/input.cpp: Drop misleading comment.
    
    A call of `cleanup_and_exit()` appears to be on every exit path out of
    troff, not merely the ones discussed.  If you instrument that function
    (or set a breakpoint in a debugger), you can observe it in all of the
    following cases.
    
    $ alias tg="./build/test-groff -z"
    $ echo | tg
    $ echo a | tg
    $ printf '.vpt 0\n' | tg
    $ printf '.de mac\n.di div\nfoo\n..\n' | tg
    $ printf '.de mac\n.di div\nfoo\n..\nbar\n' | tg
    $ printf '.de mac\n.di div\nfoo\n.di\n..\nbar\n' | tg
    $ printf '.de mac\n.di div\nfoo\n.di\n..\n.mac\n.div\nbar\n' | tg
    $ printf '.de mac\n.di div\nfoo\n..\n.wh -1i mac\n' | tg
    $ printf '.de mac\n.di div\nfoo\n..\n.wh -1i mac\nbar\n' | tg
    troff: error: can't continue page ejection because of current diversion
    $ printf '.de mac\n.di div\nfoo\n.di\n..\n.wh -1i mac\nbar\n' | tg
    
    Thus, contra the comment, the code is reached regardless of whether
    vertical position traps are enabled, regardless of whether a trap-called
    macro starts a diversion and, for that matter, regardless of whether
    said trap-called macro also ends the diversion before input ends.
---
 src/roff/troff/input.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 8aadc243..8a1cd47a 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2605,8 +2605,6 @@ void exit_troff()
     tok.next();
     process_input_stack();
   }
-  // This will only happen if a trap-called macro starts a diversion,
-  // or if vertical position traps have been disabled.
   cleanup_and_exit(EXIT_SUCCESS);
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]