summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2/Util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IcePatch2/Util.cpp')
-rw-r--r--cpp/src/IcePatch2/Util.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp
index 885d7fff797..49da0c2edba 100644
--- a/cpp/src/IcePatch2/Util.cpp
+++ b/cpp/src/IcePatch2/Util.cpp
@@ -263,12 +263,15 @@ IcePatch2::simplify(const string& path)
bool
IcePatch2::isAbsolute(const string& pa)
{
- const string path = simplify(pa);
-
+ unsigned i = 0;
+ while(isspace(pa[i]))
+ {
+ ++i;
+ }
#ifdef _WIN32
- return path[0] == '/' || path.size() > 1 && isalpha(path[0]) && path[1] == ':';
+ return pa[i] == '\\' || pa[i] == '/' || pa.size() > i + 1 && isalpha(pa[i]) && pa[i + 1] == ':';
#else
- return path[0] == '/';
+ return pa[i] == '/';
#endif
}