From 6a9b662b50927b2dbe3c8d383f04d1d7b649b28f Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 8 Aug 2026 12:49:57 -1000 Subject: Gather page output into one buffer --- source/cgit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/cgit.c') diff --git a/source/cgit.c b/source/cgit.c index 5cb52fd..2ecfb4f 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -1087,6 +1087,9 @@ int cmd_main(int argc, const char **argv) isolate_git_environment(); cgit_init_filters(); atexit(cgit_cleanup_filters); + // Registered second so it runs first, since exit is reached from error + // paths and from the HEAD shortcut with a page still buffered. + atexit(html_flush); set_die_routine(cgit_die_routine); prepare_context(); -- cgit v2.8.0