misc gp2x tweaks
authornotaz <notasas@gmail.com>
Tue, 8 Dec 2009 19:50:24 +0000 (19:50 +0000)
committernotaz <notasas@gmail.com>
Tue, 8 Dec 2009 19:50:24 +0000 (19:50 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@839 be3aeb3a-fb24-0410-a615-afba39da0efa

common/menu.c

index 8e3b9dd..b5e5e36 100644 (file)
@@ -797,10 +797,13 @@ rescan:
 \r
        n = scandir(curr_path, &namelist, scandir_filter, (void *)scandir_cmp);\r
        if (n < 0) {\r
+               char *t;\r
                lprintf("menu_loop_romsel failed, dir: %s\n", curr_path);\r
 \r
                // try root\r
-               plat_get_root_dir(curr_path, len);\r
+               t = getcwd(curr_path, len);\r
+               if (t == NULL)\r
+                       plat_get_root_dir(curr_path, len);\r
                n = scandir(curr_path, &namelist, scandir_filter, (void *)scandir_cmp);\r
                if (n < 0) {\r
                        // oops, we failed\r