From 6d475ad6b8af65b7b83e189b2e6837146a8a7947 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Fri, 27 Aug 2010 21:16:43 +0000 Subject: [PATCH] In list_dir_el make sure PHYSFS_getRealDir won't give NULL to strcmp which will happen for files located in a Windows root directory --- CHANGELOG.txt | 4 ++++ main/menu.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index beedd3ddd..2289cadd7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20100828 +-------- +main/menu.c: In list_dir_el make sure PHYSFS_getRealDir won't give NULL to strcmp which will happen for files located in a Windows root directory + 20100827 -------- arch/include/jukebox.h, arch/sdl/jukebox.c, include/u_mem.h, main/menu.c: Add path browsing feature to make song file/directory selection easier diff --git a/main/menu.c b/main/menu.c index 57ab954f6..169a26bb1 100644 --- a/main/menu.c +++ b/main/menu.c @@ -1162,7 +1162,7 @@ void list_dir_el(browser *b, const char *origdir, const char *fname) if (ext) for (i = b->ext_list; *i != NULL && stricmp(ext, *i); i++) {} // see if the file is of a type we want - if ((!strcmp(PHYSFS_getRealDir(fname), b->view_path)) && (PHYSFS_isDirectory(fname) || (ext && *i)) + if ((!strcmp((PHYSFS_getRealDir(fname)==NULL?"":PHYSFS_getRealDir(fname)), b->view_path)) && (PHYSFS_isDirectory(fname) || (ext && *i)) #if defined(__MACH__) && defined(__APPLE__) && stricmp(fname, "Volumes") // this messes things up, use '..' instead #endif