From 1fc6d8c8992c693d849c8e03a03dd05950102b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Fu=C3=9F?= Date: Thu, 9 Feb 2017 09:08:48 +0100 Subject: [PATCH] Fix for traditional glob(3) behaviour fixes #4778 --- lib/base/utility.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index c29284019..6cb2ed107 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -48,6 +48,7 @@ # include # include # include +# include #endif /* _WIN32 */ #ifdef _WIN32 @@ -502,6 +503,16 @@ static bool GlobHelper(const String& pathSpec, int type, std::vector& fi } #endif /* _WIN32 */ +#ifndef _WIN32 +static int GlobErrorHandler(const char *epath, int eerrno) +{ + if (eerrno == ENOTDIR) + return 0; + + return eerrno; +} +#endif /* _WIN32 */ + /** * Calls the specified callback for each file matching the path specification. * @@ -556,7 +567,7 @@ bool Utility::Glob(const String& pathSpec, const boost::function