fix for non existing dirs in ls-dir

This commit is contained in:
VaclavT 2021-03-22 06:50:46 +01:00
parent 56407f3516
commit 48ad953648
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ MlValue list_dir(const std::string &path) {
DIR *dirp = opendir(path.c_str());
if (dirp == NULL) {
// handle error - probably not a dir or non existing path
throw std::runtime_error("could not open dir (" + path + ")");
}
struct dirent *dp;
while ((dp = readdir(dirp)) != NULL) {