From ee06c1237495f6a2379dfde0d8113214398b497c Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 21 Aug 2011 14:30:28 +0200 Subject: [PATCH] Fix sg_dir dot-file handling 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simgear/misc/sg_dir.cxx b/simgear/misc/sg_dir.cxx index 59f96dfa..95929229 100644 --- a/simgear/misc/sg_dir.cxx +++ b/simgear/misc/sg_dir.cxx @@ -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; } -- 2.39.5