From 1c80aa32e258b643188dc63d1c012dd6eeb3374c Mon Sep 17 00:00:00 2001 From: oblerion <82583559+oblerion@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:04:19 +0100 Subject: [PATCH] Update rcore.c --- src/rcore.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 0f4bd119c..696a1a058 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1948,17 +1948,14 @@ const char *GetFileNameWithoutExt(const char *filePath) { if (filePath != NULL) { - const char *fileName = GetFileName(filePath); // get filename without path - int pos = (int)strlen(fileName); // get filename lenght - for (int i = pos; i>0; i--) + const char *fileName = GetFileName(filePath); // Get filename without path + for (int i = (int)strlen(fileName); i>0; i--) // reverse search { if (fileName[i] == '.') { - pos = i; - break; + return TextSubtext(fileName,0,i); } } - return TextSubtext(fileName,0,pos); } return "\0"; }