summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-07 12:50:19 +0200
committerGitHub <noreply@github.com>2016-08-07 12:50:19 +0200
commit876496c953d4c9c4b12befbdf4d41fe839644ac9 (patch)
tree37455e6c0485aa0ef5b378cf8638b504881e96a1
parentCanonical tag (#3300) (diff)
downloadcuberite-876496c953d4c9c4b12befbdf4d41fe839644ac9.tar
cuberite-876496c953d4c9c4b12befbdf4d41fe839644ac9.tar.gz
cuberite-876496c953d4c9c4b12befbdf4d41fe839644ac9.tar.bz2
cuberite-876496c953d4c9c4b12befbdf4d41fe839644ac9.tar.lz
cuberite-876496c953d4c9c4b12befbdf4d41fe839644ac9.tar.xz
cuberite-876496c953d4c9c4b12befbdf4d41fe839644ac9.tar.zst
cuberite-876496c953d4c9c4b12befbdf4d41fe839644ac9.zip
-rw-r--r--src/OSSupport/File.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp
index b4e4c3f6f..a59f599ae 100644
--- a/src/OSSupport/File.cpp
+++ b/src/OSSupport/File.cpp
@@ -524,6 +524,13 @@ AStringVector cFile::GetFolderContents(const AString & a_Folder)
{
do
{
+ if (
+ (strcmp(FindFileData.cFileName, ".") == 0) ||
+ (strcmp(FindFileData.cFileName, "..") == 0)
+ )
+ {
+ continue;
+ }
AllFiles.push_back(FindFileData.cFileName);
} while (FindNextFileA(hFind, &FindFileData));
FindClose(hFind);
@@ -546,6 +553,13 @@ AStringVector cFile::GetFolderContents(const AString & a_Folder)
struct dirent *dirp;
while ((dirp = readdir(dp)) != nullptr)
{
+ if (
+ (strcmp(dirp->d_name, ".") == 0) ||
+ (strcmp(dirp->d_name, "..") == 0)
+ )
+ {
+ continue;
+ }
AllFiles.push_back(dirp->d_name);
}
closedir(dp);