1
0
Fork 0

(svn r18891) -Fix: Avoid duplicate path separator when searching for PNG files which prevented tar-lookups.

release/1.0
peter1138 2010-01-22 23:55:20 +00:00
parent 3df9caa86a
commit 200dc6821f
1 changed files with 3 additions and 1 deletions

View File

@ -39,7 +39,9 @@ static bool OpenPNGFile(const char *filename, uint32 id, bool mask)
{
char png_file[MAX_PATH];
snprintf(png_file, sizeof(png_file), "sprites" PATHSEP "%s" PATHSEP "%d%s.png", filename, id, mask ? "m" : "");
/* Add path separator after 'sprites' if not present */
const char *sep = (filename[0] == PATHSEPCHAR) ? "" : PATHSEP;
snprintf(png_file, sizeof(png_file), "sprites%s%s" PATHSEP "%d%s.png", sep, filename, id, mask ? "m" : "");
if (FioCheckFileExists(png_file)) {
FioOpenFile(PNG_SLOT, png_file);
return true;