[PATCH] awk long field separators

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 12 13:37:55 UTC 2009


On Tuesday 07 April 2009 01:06, Ian Wienand wrote:
> We noticed a problem where long field separators were not splitting
> right.  e.g.
> 
> # cat input
> a--
> a--b--
> a--b--c--
> a--b--c--d--
> 
> --- busybox ---
> # cat input | awk -F-- '{print NF, length($NF), $NF}'
> 2 1 -
> 3 2 --
> 4 3 c--
> 5 4 -d--
> 
> --- gawk ---
> # cat input | awk -F-- '{print NF, length($NF), $NF}'
> 2 0
> 3 0
> 4 0
> 5 0
> 
> I believe the solution is to overwrite all of the separators with null
> before moving on.
> 
> Patch with testcase included.

Wow, even with testcase.

Applied, thanks!

> The octal awk test is failing for me on 
> plain SVN too.

Does switching on ENABLE_DESKTOP help?

Where do you use busybox?
--
vda


More information about the busybox mailing list