Makes mmaps_generator find locale correctly master
authorRaphaël Gertz <git@rapsys.eu>
Tue, 1 May 2018 22:21:32 +0000 (00:21 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 1 May 2018 22:21:32 +0000 (00:21 +0200)
src/tools/mmaps_generator/PathCommon.h

index 31ac3711b4bca0cb710adf96563aff40382a47df..54a3b66a954dd7c56187e60aeda0b149ff7d4a61 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef _WIN32
     #include <cstddef>
     #include <dirent.h>
+    #include <cstring>
 #else
     #include <Windows.h>
 #endif
@@ -106,8 +107,11 @@ namespace MMAP
             errno = 0;
             if ((dp = readdir(dirp)) != NULL)
             {
-                if (matchWildcardFilter(filter.c_str(), dp->d_name))
-                    fileList.push_back(std::string(dp->d_name));
+                if (matchWildcardFilter(filter.c_str(), dp->d_name)) {
+                    if (strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) {
+                        fileList.push_back(std::string(dp->d_name));
+                    }
+                }
             }
             else
                 break;