From e29a4513b6a34a13621ee40655f0478022a74c0b Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Mon, 7 Nov 2016 17:24:13 +0800 Subject: [PATCH] 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) --- common/ui/file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/ui/file.cpp b/common/ui/file.cpp index f3c5c198c..371b76932 100644 --- a/common/ui/file.cpp +++ b/common/ui/file.cpp @@ -41,7 +41,7 @@ static PHYSFSX_counted_list file_getdirlist(const char *dir) { ntstring 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)};