From 5be24a3642c294e4fcec465c9c6f19d66cf2220d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 22 Sep 2023 15:24:51 +0000 Subject: Remove case_str use Signed-off-by: Laurent Bercot --- src/s6-portable-utils/s6-grep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/s6-portable-utils/s6-grep.c b/src/s6-portable-utils/s6-grep.c index ebfa064..98bde99 100644 --- a/src/s6-portable-utils/s6-grep.c +++ b/src/s6-portable-utils/s6-grep.c @@ -1,9 +1,10 @@ /* ISC license. */ +#include + #include #include #include -#include #include #include @@ -66,7 +67,6 @@ int main (int argc, char const *const *argv) stralloc line = STRALLOC_ZERO ; regex_t re ; unsigned int num = 0 ; - size_t arglen = strlen(argv[0]) ; if (!flags.fixed) { int e = skalibs_regcomp(&re, argv[0], REG_NOSUB | (flags.extended ? REG_EXTENDED : 0) | (flags.ignorecase ? REG_ICASE : 0)) ; @@ -93,7 +93,7 @@ int main (int argc, char const *const *argv) if (flags.fixed) { if (flags.ignorecase) - r = case_str(line.s, argv[0]) >= arglen ; + r = !strcasestr(line.s, argv[0]) ; else r = !strstr(line.s, argv[0]) ; } -- cgit 1.4.1