From d3f65407868f174afd57b45336e9602885f99543 Mon Sep 17 00:00:00 2001 From: Andrea Chiavazza Date: Mon, 9 Jun 2025 18:52:28 +0100 Subject: [PATCH] Fix comparison of bootcore= argument (#993) --- bootcore.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/bootcore.cpp b/bootcore.cpp index 2084407..0c79a7f 100644 --- a/bootcore.cpp +++ b/bootcore.cpp @@ -119,7 +119,6 @@ char* loadLastcore() char *findCore(const char *name, char *coreName, int indent) { - char *spl; DIR *dir; struct dirent *entry; @@ -144,16 +143,11 @@ char *findCore(const char *name, char *coreName, int indent) return indir; } } - else { + else if (!strcmp(entry->d_name, coreName)) + { snprintf(path, 256, "%s/%s", name, entry->d_name); - if (strstr(path, coreName) != NULL) { - spl = strrchr(path, '.'); - if (spl && (!strcmp(spl, ".rbf") || !strcmp(spl, ".mra") || !strcmp(spl, ".mgl"))) - { - closedir(dir); - return path; - } - } + closedir(dir); + return path; } } closedir(dir);