From 6bf11d6720bc0ef58d68c454cc1f5e9772d41391 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Oct 2012 23:57:07 +0000 Subject: [PATCH] Change the way directory iteration flags are constructed. Instead of explicitly constructing the flags from the flags that should be included, construct them by excluding the flags that shouldn't be used. This makes the code more stable in the sense that it will continue to work when new flags, such as the upcoming wxDIR_NO_FOLLOW, are added. See #14542. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dircmn.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/dircmn.cpp b/src/common/dircmn.cpp index 1638cff0ac..7faa5bb3ea 100644 --- a/src/common/dircmn.cpp +++ b/src/common/dircmn.cpp @@ -115,7 +115,9 @@ size_t wxDir::Traverse(wxDirTraverser& sink, if ( flags & wxDIR_DIRS ) { wxString dirname; - for ( bool cont = GetFirst(&dirname, wxEmptyString, wxDIR_DIRS | (flags & wxDIR_HIDDEN) ); + for ( bool cont = GetFirst(&dirname, wxEmptyString, + (flags & ~(wxDIR_FILES | wxDIR_DOTDOT)) + | wxDIR_DIRS); cont; cont = cont && GetNext(&dirname) ) { -- 2.45.2