summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-30 14:21:42 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-30 14:21:42 -0500
commit5a7ca9106a305555922ef78c2dd84ab8779c7718 (patch)
treefe35f09c8ff1b0880196425333013a3526b4eed2 /util.c
parented8a56cc65411b8d00e4a8a9366855ea101f2e27 (diff)
fixed warnings on GCC, fixed opening an absolute path, README
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.c b/util.c
index 7a970a2..ed0b178 100644
--- a/util.c
+++ b/util.c
@@ -217,3 +217,11 @@ static char const *path_filename(char const *path) {
// (a relative path with no path separators)
return path;
}
+
+static bool path_is_absolute(char const *path) {
+ return path[0] == PATH_SEPARATOR
+ #if _WIN32
+ || path[1] == ':' && path[2] == PATH_SEPARATOR
+ #endif
+ ;
+}