summaryrefslogtreecommitdiff
path: root/mysys/my_getwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_getwd.c')
-rw-r--r--mysys/my_getwd.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c
index d6f647254e8..89f949eca27 100644
--- a/mysys/my_getwd.c
+++ b/mysys/my_getwd.c
@@ -192,3 +192,25 @@ int test_if_hard_path(register const char *dir_name)
return FALSE;
#endif
} /* test_if_hard_path */
+
+
+/*
+ Test if a name contains an (absolute or relative) path.
+
+ SYNOPSIS
+ has_path()
+ name The name to test.
+
+ RETURN
+ TRUE name contains a path.
+ FALSE name does not contain a path.
+*/
+
+my_bool has_path(const char *name)
+{
+ return test(strchr(name, FN_LIBCHAR))
+#ifdef FN_DEVCHAR
+ || test(strchr(name, FN_DEVCHAR))
+#endif
+ ;
+}