diff --git a/mongoose.c b/mongoose.c index b8efa53e..20ecefaa 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1445,6 +1445,7 @@ bool mg_log_prefix(int level, const char *file, int line, const char *fname) { int max = LL_INFO; struct mg_str k, v, s = mg_str(s_spec); const char *p = strrchr(file, '/'); + if (p == NULL) p = strrchr(file, '\\'); p = p == NULL ? file : p + 1; if (s_fn == NULL) return false; diff --git a/src/log.c b/src/log.c index 8761371e..6ff3e08a 100644 --- a/src/log.c +++ b/src/log.c @@ -23,6 +23,7 @@ bool mg_log_prefix(int level, const char *file, int line, const char *fname) { int max = LL_INFO; struct mg_str k, v, s = mg_str(s_spec); const char *p = strrchr(file, '/'); + if (p == NULL) p = strrchr(file, '\\'); p = p == NULL ? file : p + 1; if (s_fn == NULL) return false;