ange how no memcards are specified
[pcsx_rearmed.git] / frontend / menu.c
index 3a6ae9c..8119505 100644 (file)
@@ -251,7 +251,9 @@ static int optional_cdimg_filter(struct dirent **namelist, int count,
                                p = strrchr(buf2, '/');
                                if (p == NULL)
                                        p = strrchr(buf2, '\\');
-                               if (p == NULL)
+                               if (p != NULL)
+                                       p++;
+                               else
                                        p = buf2;
 
                                snprintf(buf, sizeof(buf), "%s/%s", basedir, p);
@@ -1698,10 +1700,10 @@ out:
 
 static void handle_memcard_sel(void)
 {
-       Config.Mcd1[0] = 0;
+       strcpy(Config.Mcd1, "none");
        if (memcard1_sel != 0)
                snprintf(Config.Mcd1, sizeof(Config.Mcd1), ".%s%s", MEMCARD_DIR, memcards[memcard1_sel]);
-       Config.Mcd2[0] = 0;
+       strcpy(Config.Mcd2, "none");
        if (memcard2_sel != 0)
                snprintf(Config.Mcd2, sizeof(Config.Mcd2), ".%s%s", MEMCARD_DIR, memcards[memcard2_sel]);
        LoadMcds(Config.Mcd1, Config.Mcd2);