From fd5875e651cf2ea4258eff2cffd007c48b9b7152 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Mon, 17 May 2021 21:12:49 -0500 Subject: [PATCH] More JoeyDev work. --- joeylib/src/joey.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/joeylib/src/joey.c b/joeylib/src/joey.c index e8d9f2e..170d3a4 100644 --- a/joeylib/src/joey.c +++ b/joeylib/src/joey.c @@ -1054,32 +1054,40 @@ jbool jlUtilInputRead(jbyte *key) { char *jlUtilMakePathname(char *filename, char *extension) { char temp[2]; - // If JOEY_TOOLS is defined, we use the filename as-is and just append the extension. - // However, if JOEY_DEV_DATA_PATH is defined, we pre-pend the name with the data path and add the extension. - // Otherwise, we pre-pend with 'data' and add the extension. - temp[0] = JOEY_PATH_SEPARATOR; temp[1] = 0; _jlTempString[0] = 0; #ifdef JOEY_TOOLS - (void)temp; #ifdef JOEY_DEV_DATA_PATH + // However, if JOEY_DEV_DATA_PATH is defined, we pre-pend the name with the data path and add the extension. // Running *UNDER* JoeyDev as a JoeyLib app. JOEY_DEV_DATA_PATH defined. + (void)temp; strcat(_jlTempString, JOEY_DEV_DATA_PATH); -#endif -#else - // Standard use case - compiled application. - strcat(_jlTempString, "data"); - strcat(_jlTempString, temp); -#endif - - // Add extension. strcat(_jlTempString, filename); if (extension != NULL) { strcat(_jlTempString, "."); strcat(_jlTempString, extension); } +#else + // If JOEY_TOOLS is defined alone, we use the filename as-is. + (void)temp; + (void)extension; + strcat(_jlTempString, filename); +#endif +#else + // Otherwise, we pre-pend with 'data' and add the extension. + // Standard use case - compiled application. + strcat(_jlTempString, "data"); + strcat(_jlTempString, temp); + strcat(_jlTempString, filename); + if (extension != NULL) { + strcat(_jlTempString, "."); + strcat(_jlTempString, extension); + } +#endif + + //printf("%s\n", _jlTempString); return _jlTempString; }