diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Gather page output into one buffer
Diffstat (limited to 'source/cgit.c')
-rw-r--r--source/cgit.c3
1 file changed, 3 insertions, 0 deletions
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();