From 80bd9d7777d0e9e84157b400ab3e07dbfab72647 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Fri, 14 Jan 2022 09:56:02 -0800 Subject: [PATCH] always return a valid path even if it's ./ --- src/rcore.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index b7da56fbb..70ebdbaac 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3014,7 +3014,8 @@ const char *GetApplicationDirectory(void) if (lib == NULL) { - appDir[0] = '\\'; + appDir[0] = '.'; + appDir[1] = '\\'; } else { @@ -3026,7 +3027,8 @@ const char *GetApplicationDirectory(void) if (getModuleFileNameExWPtr == NULL) { - appDir[0] = '\\'; + appDir[0] = '.'; + appDir[1] = '\\'; } else { @@ -3049,6 +3051,11 @@ const char *GetApplicationDirectory(void) } } } + else + { + appDir[0] = '.'; + appDir[1] = '\\'; + } } FreeLibrary(lib); @@ -3070,7 +3077,8 @@ const char *GetApplicationDirectory(void) } else { - appDir[0] = '/'; + appDir[0] = '.'; + appDir[1] = '/'; } #elif defined(__APPLE__) uint32_t size = sizeof(appDir); @@ -3089,7 +3097,8 @@ const char *GetApplicationDirectory(void) } else { - appDir[0] = '/'; + appDir[0] = '.'; + appDir[1] = '/'; } #endif