]> git.mxchange.org Git - simgear.git/commitdiff
Fix sg_dir dot-file handling
authorThorstenB <brehmt@gmail.com>
Sun, 21 Aug 2011 12:30:28 +0000 (14:30 +0200)
committerThorstenB <brehmt@gmail.com>
Sun, 21 Aug 2011 12:31:08 +0000 (14:31 +0200)
File dialogs never showed ".." directories for navigation, since these were
filtered by the "INCLUDE_HIDDEN" option. Only the "NO_DOT_OR_DOTDOT"
option should be used for filtering - otherwise it's impossible to show
the "."/".." directories while all other files are still hidden.

simgear/misc/sg_dir.cxx

index 59f96dfa8fb5598693e1192e19db3f061c5379e6..95929229a57a6b01647351d42ef45c4f548f1f13 100644 (file)
@@ -115,7 +115,8 @@ PathList Dir::children(int types, const std::string& nameFilter) const
     }
     
     // skip hidden files (names beginning with '.') unless requested
-    if (!(types & INCLUDE_HIDDEN) && (entry->d_name[0] == '.')) {
+    if (!(types & INCLUDE_HIDDEN) && (entry->d_name[0] == '.') &&
+         strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) {
       continue;
     }