From 0d8e5fbc31e1082063bfb5155c35b7869721152b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 10 Mar 2026 21:26:55 +0100 Subject: cgit: override die routine globally We don't get any return value from compile_grep_patterns calling compile_regexp_failed, causing the default die routine to print to stderr and then for cgit to exit ungracefully. Instead override the default die routine to show a normal error page. Perhaps compile_grep_patterns ought to change upstream to return an error. But this commit here will handle future issues as well, so perhaps not a bad idea to do anyway. Link: https://lists.zx2c4.com/pipermail/cgit/2026-March/004982.html Link: https://lists.zx2c4.com/pipermail/cgit/2026-March/004983.html Reported-by: Adrian C. Reported-by: Aiden Woodruff Signed-off-by: Jason A. Donenfeld --- ui-shared.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ui-shared.h') diff --git a/ui-shared.h b/ui-shared.h index f12fa99..2a3a7f5 100644 --- a/ui-shared.h +++ b/ui-shared.h @@ -73,6 +73,7 @@ extern void cgit_print_docstart(void); extern void cgit_print_docend(void); __attribute__((format (printf,3,4))) extern void cgit_print_error_page(int code, const char *msg, const char *fmt, ...); +extern void cgit_vprint_error_page(int code, const char *msg, const char *fmt, va_list ap); extern void cgit_print_pageheader(void); extern void cgit_print_filemode(unsigned short mode); extern void cgit_compose_snapshot_prefix(struct strbuf *filename, -- cgit v1.2.3