From 91d11c88b74cc729b8b2a00cf813bdd44e18dc8e Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Wed, 25 Oct 2017 12:02:25 -0700 Subject: [PATCH] Do the right thing with empty directory path. When we convert a file that's in our CWD, on Unix the folder component of the path will simply be "", whereas opendir() wants ".". I want to take another more substantial pass at texture resolution, once we're out of urgent bugfix mode. --- src/utils/File_Utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/File_Utils.cpp b/src/utils/File_Utils.cpp index 1741498..94c10e1 100644 --- a/src/utils/File_Utils.cpp +++ b/src/utils/File_Utils.cpp @@ -102,7 +102,7 @@ namespace FileUtils { { std::vector fileList; #if defined( __unix__ ) || defined( __APPLE__ ) - DIR *dir = opendir(folder); + DIR *dir = opendir(strlen(folder) > 0 ? folder : "."); if (dir != nullptr) { for (;;) { struct dirent *dp = readdir(dir);