summaryrefslogtreecommitdiff
path: root/src/fs/files.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/files.cpp')
-rw-r--r--src/fs/files.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/fs/files.cpp b/src/fs/files.cpp
index 7cefef985..9d7bfd125 100644
--- a/src/fs/files.cpp
+++ b/src/fs/files.cpp
@@ -287,11 +287,11 @@ void Files::enumFiles(StringVect &files,
{
if (findLast(path, dirSeparator) == false)
path += dirSeparator;
- const struct dirent *next_file = nullptr;
DIR *const dir = opendir(path.c_str());
if (dir)
{
+ const struct dirent *next_file = nullptr;
while ((next_file = readdir(dir)))
{
const std::string file = next_file->d_name;
@@ -313,4 +313,3 @@ void Files::enumFiles(StringVect &files,
closedir(dir);
}
}
-