[scripts] env: colorize git output
[openwrt.git] / package / busybox / patches / 510-awk_include.patch
index 7284bbc..9f525ac 100644 (file)
@@ -1,6 +1,11 @@
 --- a/editors/awk.c
 +++ b/editors/awk.c
-@@ -53,9 +53,14 @@ typedef struct chain_s {
+@@ -1,3 +1,4 @@
++
+ /* vi: set sw=4 ts=4: */
+ /*
+  * awk implementation for busybox
+@@ -81,9 +82,14 @@ typedef struct chain_s {
  } chain;
  
  /* Function */
@@ -15,7 +20,7 @@
  } func;
  
  /* I/O stream */
-@@ -1423,7 +1428,8 @@ static void parse_program(char *p)
+@@ -1473,7 +1479,8 @@ static void parse_program(char *p)
                        next_token(TC_FUNCTION);
                        g_pos++;
                        f = newfunc(t_string);
                        f->nargs = 0;
                        while (next_token(TC_VARIABLE | TC_SEQTERM) & TC_VARIABLE) {
                                v = findvar(ahash, t_string);
-@@ -1432,7 +1438,7 @@ static void parse_program(char *p)
+@@ -1482,7 +1489,7 @@ static void parse_program(char *p)
                                if (next_token(TC_COMMA | TC_SEQTERM) & TC_SEQTERM)
                                        break;
                        }
--                      seq = &(f->body);
-+                      seq = &(f->x.body);
+-                      seq = &f->body;
++                      seq = &f->x.body;
                        chain_group();
                        clear_array(ahash);
  
-@@ -2397,7 +2403,8 @@ static var *evaluate(node *op, var *res)
-                       break;
+@@ -2580,7 +2587,8 @@ static var *evaluate(node *op, var *res)
+                       var *vbeg, *v;
+                       const char *sv_progname;
  
-               case XC( OC_FUNC ):
 -                      if (!op->r.f->body.first)
 +                      if ((op->r.f->type == AWKFUNC) &&
 +                              !op->r.f->x.body.first)
                                syntax_error(EMSG_UNDEF_FUNC);
  
-                       X.v = R.v = nvalloc(op->r.f->nargs+1);
-@@ -2414,7 +2421,10 @@ static var *evaluate(node *op, var *res)
-                       fnargs = X.v;
+                       vbeg = v = nvalloc(op->r.f->nargs + 1);
+@@ -2597,7 +2605,10 @@ static var *evaluate(node *op, var *res)
+                       fnargs = vbeg;
+                       sv_progname = g_progname;
  
-                       L.s = g_progname;
 -                      res = evaluate(op->r.f->body.first, res);
 +                      if (op->r.f->type == AWKFUNC)
 +                              res = evaluate(op->r.f->x.body.first, res);
 +                      else if (op->r.f->type == CFUNC)
 +                              res = op->r.f->x.cfunc(res, fnargs, op->r.f->nargs);
-                       g_progname = L.s;
  
+                       g_progname = sv_progname;
                        nvfree(fnargs);
-@@ -2777,6 +2787,143 @@ static rstream *next_input_file(void)
+@@ -2991,6 +3002,143 @@ static rstream *next_input_file(void)
  #undef files_happen
  }
  
  int awk_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
  int awk_main(int argc, char **argv)
  {
-@@ -2842,6 +2989,9 @@ int awk_main(int argc, char **argv)
+@@ -3056,6 +3204,9 @@ int awk_main(int argc, char **argv)
                        *s1 = '=';
                }
        }
This page took 0.023102 seconds and 4 git commands to generate.