summaryrefslogtreecommitdiffstats
path: root/src/portable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/portable.cpp')
-rw-r--r--src/portable.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/portable.cpp b/src/portable.cpp
index bb13ddb..554bb0b 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -409,3 +409,22 @@ void portable_sleep(int ms)
usleep(1000*ms);
#endif
}
+
+bool portable_isAbsolutePath(const char *fileName)
+{
+# ifdef _WIN32
+ if (isalpha (fileName [0]) && fileName[1] == ':')
+ fileName += 2;
+# endif
+ char const fst = fileName [0];
+ if (fst == '/') {
+ return true;
+ }
+# ifdef _WIN32
+ if (fst == '\\')
+ return true;
+# endif
+ return false;
+}
+
+