From b92ecc6dcd18e721c31a0fef744a73ed9747a3ee Mon Sep 17 00:00:00 2001 From: Tavis Ormandy Date: Mon, 30 May 2022 10:35:19 -0700 Subject: [PATCH] Fix print to file crash, see #50 --- globalize.lst | 1 + lotdefs.h | 1 + main.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/globalize.lst b/globalize.lst index d4843be..feca7af 100644 --- a/globalize.lst +++ b/globalize.lst @@ -57,3 +57,4 @@ at_date encode_date check_three_numbers get_integer +need_to_close diff --git a/lotdefs.h b/lotdefs.h index 22ac18f..c0bb024 100644 --- a/lotdefs.h +++ b/lotdefs.h @@ -91,5 +91,6 @@ extern int reset_undo(int); extern void full_redisplay(); extern int erase_screen(); extern int invalidate_screen(); +extern int16_t need_to_close; #endif diff --git a/main.c b/main.c index 83f2225..bbb9164 100644 --- a/main.c +++ b/main.c @@ -68,6 +68,9 @@ int main(int argc, char **argv, char **envp) // Enable undo by default, you can disable it via -u. reset_undo(1); + // No need to close the printer driver, it is currently a noop. + need_to_close = false; + while ((opt = getopt(argc, argv, "f:c:k:np:w:hbu")) != -1) { switch (opt) { case 'b': banner_printed = false;