From f1e146906a2138c614d4204b4f376530e0cb00c7 Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 8 Jan 2024 23:14:22 +0300 Subject: [PATCH 1/3] Mention crash log in crash popup --- src/sdl/i_system.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index a3813767c..5343c41de 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -420,7 +420,7 @@ static void I_ReportSignal(int num, int coredumped) { //static char msg[] = "oh no! back to reality!\r\n"; const char * sigmsg; - char msg[128]; + char msg[256]; switch (num) { @@ -459,15 +459,25 @@ static void I_ReportSignal(int num, int coredumped) sprintf(msg, "%s (core dumped)", sigmsg); else strcat(msg, " (core dumped)"); - - sigmsg = msg; } + else + { + sprintf(msg, "%s", sigmsg); + } + +#ifdef HAVE_LIBBACKTRACE + strncat(msg, "\n\nCrash report have been saved into srb2kart-crash-log.txt", 255); +#elif defined(_WIN32) + // Uuh assume we are on 32bit windows where we still have rpt files? + // Really unsure about this one + strncat(msg, "\n\nCrash report have been saved into srb2kart.rpt", 255); +#endif I_OutputMsg("\nProcess killed by signal: %s\n\n", sigmsg); SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Process killed by signal", - sigmsg, NULL); + msg, NULL); } #ifndef NEWSIGNALHANDLER From c4bb4965e13622068c7d46f698013351beef91ae Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 8 Jan 2024 23:35:34 +0300 Subject: [PATCH 2/3] Better check for 32 bit windows in I_ReportSignal --- src/sdl/i_system.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 5343c41de..48ea7fea3 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -467,9 +467,7 @@ static void I_ReportSignal(int num, int coredumped) #ifdef HAVE_LIBBACKTRACE strncat(msg, "\n\nCrash report have been saved into srb2kart-crash-log.txt", 255); -#elif defined(_WIN32) - // Uuh assume we are on 32bit windows where we still have rpt files? - // Really unsure about this one +#elif defined(_WIN32) && !defined(__MINGW64__) strncat(msg, "\n\nCrash report have been saved into srb2kart.rpt", 255); #endif From 6d642b124aca31421692395639f2ea3df600c090 Mon Sep 17 00:00:00 2001 From: Indev Date: Wed, 17 Jan 2024 16:48:11 +0300 Subject: [PATCH 3/3] Fix typo --- src/sdl/i_system.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 48ea7fea3..c04434347 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -466,9 +466,9 @@ static void I_ReportSignal(int num, int coredumped) } #ifdef HAVE_LIBBACKTRACE - strncat(msg, "\n\nCrash report have been saved into srb2kart-crash-log.txt", 255); + strncat(msg, "\n\nCrash report has been saved into srb2kart-crash-log.txt", 255); #elif defined(_WIN32) && !defined(__MINGW64__) - strncat(msg, "\n\nCrash report have been saved into srb2kart.rpt", 255); + strncat(msg, "\n\nCrash report has been saved into srb2kart.rpt", 255); #endif I_OutputMsg("\nProcess killed by signal: %s\n\n", sigmsg);