From 840995d9941dac54d033954a0e3680871769a11e Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Fri, 15 Nov 2019 09:06:05 +0100 Subject: [PATCH] Fix bug in Windows crash reporter, was sometimes missing crashes as it always ignored the first core file. --- src/crashreport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crashreport.c b/src/crashreport.c index d17bca87a..91ae199b4 100644 --- a/src/crashreport.c +++ b/src/crashreport.c @@ -63,7 +63,7 @@ char *find_best_coredump(void) if (hFile == INVALID_HANDLE_VALUE) return NULL; - while (FindNextFile(hFile, &hData)) + do { char *fname = hData.cFileName; if (!strstr(fname, ".done")) @@ -77,7 +77,7 @@ char *find_best_coredump(void) strlcpy(best_fname, buf, sizeof(best_fname)); } } - } + } while (FindNextFile(hFile, &hData)); FindClose(hFile); #endif