diff -r bdec069d2239 -r 73b3485e96f1 src/server/ucx/string.c --- a/src/server/ucx/string.c Thu Jul 11 14:21:23 2013 +0200 +++ b/src/server/ucx/string.c Tue Jul 16 12:14:13 2013 +0200 @@ -31,6 +31,7 @@ #include #include "string.h" +#include "allocator.h" sstr_t sstr(char *s) { sstr_t string; @@ -106,6 +107,18 @@ return new_sstr; } +sstr_t sstrchr(sstr_t s, int c) { + for(size_t i=0;imalloc(allocator->pool, s.length + 1); + if (newstring.ptr) { + newstring.length = s.length; + newstring.ptr[newstring.length] = 0; + + memcpy(newstring.ptr, s.ptr, s.length); + } else { + newstring.length = 0; + } + return newstring; } @@ -218,7 +245,6 @@ return newstr; } - // webserver extension int sstr_startswith(sstr_t string, sstr_t cmp) {