From 200dc6821f7b8698f9228cedcce28619a1e30d4a Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 22 Jan 2010 23:55:20 +0000 Subject: (svn r18891) -Fix: Avoid duplicate path separator when searching for PNG files which prevented tar-lookups. --- src/spriteloader/png.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/spriteloader/png.cpp b/src/spriteloader/png.cpp index 92e0c6d76..e72f44010 100644 --- a/src/spriteloader/png.cpp +++ b/src/spriteloader/png.cpp @@ -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; -- cgit v1.2.3-70-g09d2