Possible issue with awk

Harald Becker ralda at gmx.de
Thu Mar 11 00:52:57 UTC 2010


> To change the busybox for-in loop behavior of awk to that of gawk the
> following steps are required:
> - add an extra node OC_WALKDONE to the end of the for-in loop node list
> - save the current variable contents in hashwalk_init (OC_WALKINIT)
> - save the current walker list in hashwalk_init (OC_WALKINIT)
> - do NOT modify hashwalk_next (OC_WALKNEXT)
> - add an execution node for OC_WALKDONE
> - restore previous walker list in OC_WALKDONE
> - restore previous variable contents in OC_WALKDONE

In addition to those the variable contents and walker list has to be
restored if the loop is exited with a return statement (in a function).
That makes it even more complicated. Saving the loop variable contents
and walker list on the variable stack is possibly a good choice, but
variable stack code (nvalloc/nvfree) needs modification/rewrite to work
properly in all cases.


More information about the busybox mailing list