From: Gunnar Beutner Date: Thu, 27 Apr 2017 03:31:44 +0000 (+0200) Subject: Clean up the IsAbsolutePath patch X-Git-Tag: v2.7.0~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d03d09160ae42e9ceb474269baa0f3b3e2e539d3;p=icinga2 Clean up the IsAbsolutePath patch refs #5168 --- diff --git a/lib/config/configcompiler.cpp b/lib/config/configcompiler.cpp index 6b5f3a3ca..1f56306c1 100644 --- a/lib/config/configcompiler.cpp +++ b/lib/config/configcompiler.cpp @@ -27,7 +27,7 @@ #include #ifdef _WIN32 -#include "Shlwapi.h" +# include #endif /* _WIN32 */ using namespace icinga; @@ -354,3 +354,14 @@ bool ConfigCompiler::HasZoneConfigAuthority(const String& zoneName) return !empty; } + + +bool ConfigCompiler::IsAbsolutePath(const String& path) +{ +#ifndef _WIN32 + return (path.GetLength() > 0 && path[0] == '/'); +#else /* _WIN32 */ + return !PathIsRelative(path.CStr()); +#endif /* _WIN32 */ +} + diff --git a/lib/config/configcompiler.hpp b/lib/config/configcompiler.hpp index 472fa2330..94ae967bd 100644 --- a/lib/config/configcompiler.hpp +++ b/lib/config/configcompiler.hpp @@ -127,14 +127,6 @@ public: static bool HasZoneConfigAuthority(const String& zoneName); - static inline bool IsAbsolutePath(const String& path) { -#ifndef _WIN32 - return (path.GetLength() > 0 && path[0] == '/'); -#else - return !PathIsRelative(path.CStr()); -#endif /* _WIN32 */ - } - private: boost::promise > m_Promise; @@ -154,6 +146,8 @@ private: static void HandleIncludeZone(const String& relativeBase, const String& tag, const String& path, const String& pattern, const String& package, std::vector& expressions); + static bool IsAbsolutePath(const String& path); + public: bool m_Eof; int m_OpenBraces;