summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-01 20:08:13 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-01 20:08:13 +0100
commit46cf4c79368daa556ed6936999ab05408f61da00 (patch)
tree2417b260af84dd734436f47dd89280223e3a8854 /utils.c
parent47627fab8f23cd3f9171fabe1f1bfdef547ccc97 (diff)
add uh_path_match()
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 847ff34..477296f 100644
--- a/utils.c
+++ b/utils.c
@@ -189,3 +189,13 @@ int uh_b64decode(char *buf, int blen, const unsigned char *src, int slen)
buf[len++] = 0;
return len;
}
+
+bool uh_path_match(const char *prefix, const char *url)
+{
+ int len = strlen(prefix);
+
+ if (strncmp(url, prefix, len) != 0)
+ return false;
+
+ return url[len] == '/' || url[len] == 0;
+}