From e75381ae39c615f4c06feac43a5e0c4cfbb07b14 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 1 Apr 2024 02:23:58 +0200 Subject: [PATCH] Improve logging when running in cygwin --- lib/defines.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/defines.h b/lib/defines.h index c1a7c97d..b99654de 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -52,7 +52,13 @@ static const char *DBG_LVL_LIST[] ={"NONE", "FAIL", "ERROR", "WARN", "IN #else #if defined(__GNUC__) #include - #define MIST_PROG program_invocation_short_name + #if defined(__CYGWIN__) + #include + static const char * cygprogname = strrchr(program_invocation_short_name, '\\')?strrchr(program_invocation_short_name, '\\')+1:program_invocation_short_name; + #define MIST_PROG cygprogname + #else + #define MIST_PROG program_invocation_short_name + #endif #else #define MIST_PROG "MistProcess" #endif