aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-11-28 12:27:14 -0800
committerRob Landley <rob@landley.net>2018-11-28 19:03:25 -0600
commitacfbb13661f425631ee7e7f01daa1eb2f3169945 (patch)
tree143f82331e80e98fb20363eeb7c207f80dca88ca /lib/lib.c
parent687992df6a48a35df61ac515b29528c887ee6373 (diff)
downloadtoybox-acfbb13661f425631ee7e7f01daa1eb2f3169945.tar.gz
macOS: replace local strnstr with strcasestr.
bionic, glibc, macOS, and musl all have strcasestr (see http://man7.org/linux/man-pages/man3/strstr.3.html). macOS (via BSD) has a strnstr that does what strnstr sounds like it should do by analogy with strnlen and strncpy. So we at least need to rename strnstr, but it probably makes more sense just to switch to strcasestr instead.
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 03f0a24d..11acba0d 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -1191,17 +1191,6 @@ char *next_printf(char *s, char **start)
return 0;
}
-// Posix inexplicably hasn't got this, so find str in line.
-char *strnstr(char *line, char *str)
-{
- long len = strlen(str);
- char *s;
-
- for (s = line; *s; s++) if (!strncasecmp(s, str, len)) break;
-
- return *s ? s : 0;
-}
-
int dev_minor(int dev)
{
return ((dev&0xfff00000)>>12)|(dev&0xff);