diff options
Diffstat (limited to 'toolbox/grep')
-rw-r--r-- | toolbox/grep/file.c | 2 | ||||
-rw-r--r-- | toolbox/grep/grep.c | 12 | ||||
-rw-r--r-- | toolbox/grep/util.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/toolbox/grep/file.c b/toolbox/grep/file.c index 86b7658..d28dff5 100644 --- a/toolbox/grep/file.c +++ b/toolbox/grep/file.c @@ -78,7 +78,9 @@ static inline int grep_refill(struct file *f) { ssize_t nr; +#ifndef ANDROID int bzerr; +#endif bufpos = buffer; bufrem = 0; diff --git a/toolbox/grep/grep.c b/toolbox/grep/grep.c index b5bb2ef..7b2c487 100644 --- a/toolbox/grep/grep.c +++ b/toolbox/grep/grep.c @@ -294,10 +294,8 @@ read_patterns(const char *fn) err(2, "%s", fn); line = NULL; len = 0; -#ifndef ANDROID while ((rlen = getline(&line, &len, f)) != -1) add_pattern(line, *line == '\n' ? 0 : (size_t)rlen); -#endif free(line); if (ferror(f)) err(2, "%s", fn); @@ -405,7 +403,7 @@ grep_main(int argc, char *argv[]) Aflag = 0; else if (Aflag > LLONG_MAX / 10) { errno = ERANGE; - err(2, NULL); + err(2, "%llu", Aflag); } Aflag = Bflag = (Aflag * 10) + (c - '0'); break; @@ -422,10 +420,10 @@ grep_main(int argc, char *argv[]) l = strtoull(optarg, &ep, 10); if (((errno == ERANGE) && (l == ULLONG_MAX)) || ((errno == EINVAL) && (l == 0))) - err(2, NULL); + err(2, "strtoull"); else if (ep[0] != '\0') { errno = EINVAL; - err(2, NULL); + err(2, "empty"); } if (c == 'A') Aflag = l; @@ -511,10 +509,10 @@ grep_main(int argc, char *argv[]) mcount = strtoull(optarg, &ep, 10); if (((errno == ERANGE) && (mcount == ULLONG_MAX)) || ((errno == EINVAL) && (mcount == 0))) - err(2, NULL); + err(2, "strtoull"); else if (ep[0] != '\0') { errno = EINVAL; - err(2, NULL); + err(2, "empty"); } break; case 'n': diff --git a/toolbox/grep/util.c b/toolbox/grep/util.c index 497db06..5712fee 100644 --- a/toolbox/grep/util.c +++ b/toolbox/grep/util.c @@ -273,7 +273,7 @@ procfile(const char *fn) return (c); } -#define iswword(x) (iswalnum((x)) || (x) == L'_') +#define iswword(x) (iswalnum((wint_t)(x)) || (x) == L'_') /* * Processes a line comparing it with the specified patterns. Each pattern @@ -323,7 +323,7 @@ procline(struct str *l, int nottext) continue; /* Check for whole word match */ if (fg_pattern[i].word && pmatch.rm_so != 0) { - wint_t wbegin, wend; + wchar_t wbegin, wend; wbegin = wend = L' '; if (pmatch.rm_so != 0 && |