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

This commit is contained in:
zicodxx 2010-08-27 21:16:43 +00:00
parent 067d54f8e3
commit 6d475ad6b8
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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