aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-12-03 11:59:57 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-12-03 11:59:57 +0600
commit9dd824ba500e70dfd9fb0731a09f3e738918ec7e (patch)
tree257f8de38729188b63d1453e6f2e7de3b2a611e1
parentd744ea3fca26d2b734cf270a89110ff1fdd84398 (diff)
downloadmpd-9dd824ba500e70dfd9fb0731a09f3e738918ec7e.tar.gz
mpd-9dd824ba500e70dfd9fb0731a09f3e738918ec7e.tar.xz
mpd-9dd824ba500e70dfd9fb0731a09f3e738918ec7e.zip
fs/Traits.hxx: don't use g_path_is_absolute
Diffstat (limited to '')
-rw-r--r--src/fs/Traits.hxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx
index 6b46f824e..51941cb70 100644
--- a/src/fs/Traits.hxx
+++ b/src/fs/Traits.hxx
@@ -24,7 +24,7 @@
#include "Compiler.h"
#ifdef WIN32
-#include <glib.h>
+#include "util/CharUtil.hxx"
#endif
#include <string>
@@ -62,23 +62,21 @@ struct PathTraits {
gcc_pure
static bool IsAbsoluteFS(const_pointer p) {
assert(p != nullptr);
-
#ifdef WIN32
- return g_path_is_absolute(p);
-#else
- return IsSeparatorFS(*p);
+ if (IsAlphaASCII(p[0]) && p[1] == ':' && IsSeparatorFS(p[2]))
+ return true;
#endif
+ return IsSeparatorFS(*p);
}
gcc_pure
static bool IsAbsoluteUTF8(const char *p) {
assert(p != nullptr);
-
#ifdef WIN32
- return g_path_is_absolute(p);
-#else
- return IsSeparatorUTF8(*p);
+ if (IsAlphaASCII(p[0]) && p[1] == ':' && IsSeparatorUTF8(p[2]))
+ return true;
#endif
+ return IsSeparatorUTF8(*p);
}
/**