This is similar to startswith() but checks if the prefix is a complete
path or a complete subdirectory (needs to end with '/').
Signed-off-by: Karel Zak <kzak@redhat.com>
return NULL;
}
+/*
+ * Match path beginning
+ */
+static inline const char *startswithpath(const char *s, const char *prefix)
+{
+ const char *p = startswith(s, prefix);
+
+ if (p && (*p == '/' || *p == '\0'))
+ return p;
+
+ return NULL;
+}
+
/*
* Match string ending.
*/