Allow empty string to be passed to file_getdirlist

This allows the open/save dialogs to work in the editor when a filename without a path separator is passed (which is the default)
This commit is contained in:
Chris Taylor 2016-11-07 17:24:13 +08:00
parent d41146bcbd
commit e29a4513b6

View file

@ -41,7 +41,7 @@ static PHYSFSX_counted_list file_getdirlist(const char *dir)
{
ntstring<PATH_MAX - 1> path;
auto dlen = path.copy_if(dir);
if (!dlen || !path.copy_if(dlen, "/"))
if ((!dlen && strlen(dir) > 0) || !path.copy_if(dlen, "/"))
return nullptr;
++ dlen;
PHYSFSX_counted_list list{PHYSFS_enumerateFiles(dir)};