diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-09-22 15:24:51 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-09-22 15:24:51 +0000 |
commit | 5be24a3642c294e4fcec465c9c6f19d66cf2220d (patch) | |
tree | 7d4207b2fcd8a3673ba1c853d658995b1080e5c0 | |
parent | f3d781e6a2c83bf014611301cb8e0466fa3b52d0 (diff) | |
download | s6-portable-utils-5be24a3642c294e4fcec465c9c6f19d66cf2220d.tar.xz |
Remove case_str use
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r-- | src/s6-portable-utils/s6-grep.c | 6 |
1 files 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 <skalibs/nonposix.h> + #include <string.h> #include <errno.h> #include <regex.h> -#include <string.h> #include <skalibs/posixplz.h> #include <skalibs/bytestr.h> @@ -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]) ; } |