aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/awk.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 9f14f0f9a..c06dd2304 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -1937,7 +1937,7 @@ static int awk_split(const char *s, node *spl, char **slist)
1937 n++; /* at least one field will be there */ 1937 n++; /* at least one field will be there */
1938 do { 1938 do {
1939 int l; 1939 int l;
1940 regmatch_t pmatch[2]; // TODO: why [2]? [1] is enough... 1940 regmatch_t pmatch[1];
1941 1941
1942 l = strcspn(s, c+2); /* len till next NUL or \n */ 1942 l = strcspn(s, c+2); /* len till next NUL or \n */
1943 if (regexec1_nonempty(icase ? spl->r.ire : spl->l.re, s, pmatch) == 0 1943 if (regexec1_nonempty(icase ? spl->r.ire : spl->l.re, s, pmatch) == 0
@@ -2166,7 +2166,7 @@ static int ptest(node *pattern)
2166static int awk_getline(rstream *rsm, var *v) 2166static int awk_getline(rstream *rsm, var *v)
2167{ 2167{
2168 char *b; 2168 char *b;
2169 regmatch_t pmatch[2]; // TODO: why [2]? [1] is enough... 2169 regmatch_t pmatch[1];
2170 int size, a, p, pp = 0; 2170 int size, a, p, pp = 0;
2171 int fd, so, eo, r, rp; 2171 int fd, so, eo, r, rp;
2172 char c, *m, *s; 2172 char c, *m, *s;
@@ -2473,7 +2473,7 @@ static NOINLINE var *exec_builtin(node *op, var *res)
2473 node *an[4]; 2473 node *an[4];
2474 var *av[4]; 2474 var *av[4];
2475 const char *as[4]; 2475 const char *as[4];
2476 regmatch_t pmatch[2]; 2476 regmatch_t pmatch[1];
2477 regex_t sreg, *re; 2477 regex_t sreg, *re;
2478 node *spl; 2478 node *spl;
2479 uint32_t isr, info; 2479 uint32_t isr, info;
@@ -3533,6 +3533,8 @@ int awk_main(int argc UNUSED_PARAM, char **argv)
3533 parse_program(llist_pop(&list_e)); 3533 parse_program(llist_pop(&list_e));
3534 } 3534 }
3535#endif 3535#endif
3536//FIXME: preserve order of -e and -f
3537//TODO: implement -i LIBRARY and -E FILE too, they are easy-ish
3536 if (!(opt & (OPT_f | OPT_e))) { 3538 if (!(opt & (OPT_f | OPT_e))) {
3537 if (!*argv) 3539 if (!*argv)
3538 bb_show_usage(); 3540 bb_show_usage();