X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fstr-fix.c;h=2610fcf7f31783d0da21e53ec9dafcd16ab49664;hb=5403c0fab834f71416e627dfd7346a577a0ca6f5;hp=a220f6217eaa197a5ab9e89353ea7e7e60dee6ff;hpb=ba1c173f544383aa6553a75dee6e6858d8f243a4;p=libucw.git diff --git a/ucw/str-fix.c b/ucw/str-fix.c index a220f621..2610fcf7 100644 --- a/ucw/str-fix.c +++ b/ucw/str-fix.c @@ -7,8 +7,8 @@ * of the GNU Lesser General Public License. */ -#include "ucw/lib.h" -#include "ucw/string.h" +#include +#include #include @@ -32,14 +32,14 @@ str_has_suffix(const char *str, const char *suffix) } int -str_hier_prefix(const char *str, const char *prefix, uns sep) +str_hier_prefix(const char *str, const char *prefix, uint sep) { while (*str && *prefix) { size_t sl=0, pl=0; - while (str[sl] && (uns) str[sl] != sep) + while (str[sl] && (uint) str[sl] != sep) sl++; - while (prefix[pl] && (uns) prefix[pl] != sep) + while (prefix[pl] && (uint) prefix[pl] != sep) pl++; if (sl != pl || memcmp(str, prefix, sl)) return 0; @@ -54,16 +54,16 @@ str_hier_prefix(const char *str, const char *prefix, uns sep) } int -str_hier_suffix(const char *str, const char *suffix, uns sep) +str_hier_suffix(const char *str, const char *suffix, uint sep) { const char *st = str + strlen(str); const char *sx = suffix + strlen(suffix); while (st > str && sx > suffix) { size_t sl=0, pl=0; - while (st-sl > str && (uns) st[-sl-1] != sep) + while (st-sl > str && (uint) st[-sl-1] != sep) sl++; - while (sx-pl > suffix && (uns) sx[-pl-1] != sep) + while (sx-pl > suffix && (uint) sx[-pl-1] != sep) pl++; if (sl != pl || memcmp(st-sl, sx-pl, sl)) return 0;