Hallo Denys!

> The fix is attached. Still doesn't work for nested "for" loops with "break"
>   
Your patch ...
- ... produce memory leak if the loop is exited with a break
- ... doesn't restore the loop variable contents if the loop is exited
with break

Please don't use this patch. It could produce more errors than it solves.

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

Is it ok to you, if I do those changes?

Harald

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to