fixed basename when using .gz roms
authorJavier S. Pedro <maemo@javispedro.com>
Mon, 7 Sep 2009 00:15:28 +0000 (02:15 +0200)
committerJavier S. Pedro <maemo@javispedro.com>
Mon, 7 Sep 2009 00:15:28 +0000 (02:15 +0200)
platform/config.cpp

index f25a259..151feee 100644 (file)
@@ -226,7 +226,16 @@ void S9xSetRomFile(const char * path)
        // Truncate base path at the last '.' char
        char * c = strrchr(basePath, '.');
        if (c) {
-               *c = '\0';
+               if (strcasecmp(c, ".gz") == 0) {
+                       // Ignore the .gz part when truncating
+                       *c = '\0';
+                       c = strrchr(basePath, '.');
+                       if (c) {
+                               *c = '\0';
+                       }
+               } else {
+                       *c = '\0';
+               }
        }
 }