diff --git a/Makefile b/Makefile index 266ba86..5fd0b50 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,6 @@ LIBUTILSRC =\ libutil/strcasestr.c\ libutil/strlcat.c\ libutil/strlcpy.c\ - libutil/strmem.c\ libutil/strsep.c\ libutil/strtonum.c\ libutil/unescape.c diff --git a/TODO b/TODO index fc0730d..225034a 100644 --- a/TODO +++ b/TODO @@ -15,5 +15,8 @@ If you are looking for some work to do on sbase, another option is to pick a utility from the list in the README which has missing flags or features noted. +What also needs to be implemented is the capability of the tools to +handle data with NUL-bytes in it. + [0] http://landley.net/toybox/roadmap.html [1] http://git.suckless.org/ubase/ diff --git a/join.c b/join.c index 3c05a6e..caf592f 100644 --- a/join.c +++ b/join.c @@ -225,7 +225,7 @@ makeline(char *s, size_t len) beg = sp; if (sep) { - if (!(end = strmem(sp, sep, seplen))) + if (!(end = utfutf(sp, sep))) eol = 1; if (!eol) { diff --git a/libutil/strmem.c b/libutil/strmem.c deleted file mode 100644 index 597d5ca..0000000 --- a/libutil/strmem.c +++ /dev/null @@ -1,23 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -char * -strmem(char *haystack, char *needle, size_t needlelen) -{ - size_t i; - - for (i = 0; i < needlelen; i++) { - if (haystack[i] == '\0') { - return NULL; - } - } - - for (; haystack[i]; i++) { - if (!(memcmp(haystack + i - needlelen, needle, needlelen))) { - return (haystack + i - needlelen); - } - } - - return NULL; -} diff --git a/util.h b/util.h index f10bf46..4c973d1 100644 --- a/util.h +++ b/util.h @@ -58,8 +58,6 @@ size_t estrlcpy(char *, const char *, size_t); #undef strsep char *strsep(char **, const char *); -char *strmem(char *, char *, size_t); - /* regex */ int enregcomp(int, regex_t *, const char *, int); int eregcomp(regex_t *, const char *, int);