diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-01 20:08:13 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-01 20:08:13 +0100 |
commit | 46cf4c79368daa556ed6936999ab05408f61da00 (patch) | |
tree | 2417b260af84dd734436f47dd89280223e3a8854 /utils.c | |
parent | 47627fab8f23cd3f9171fabe1f1bfdef547ccc97 (diff) |
add uh_path_match()
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; +} |