adding lineno implementation

Denys Vlasenko vda.linux at googlemail.com
Mon Jan 15 11:16:46 UTC 2018


On Mon, Jan 15, 2018 at 10:52 AM, daggs <daggs at gmx.com> wrote:
> Greetings,
>
> I'm trying to add LINENO implementation to hush, I've decided to check for new lines in i_getch calls and it seems to work but with one bug, in loops, the value gets updated wrongly.
>
> here is my test output:
> #!/bin/bash
>
> t=0
>
> echo "at line ${LINENO}"
> while [ ${t} -lt 10 ]; do
> echo "at line ${LINENO}"
>        t=$((t+1))
> done
> echo "at line ${LINENO}"
>
> echo "hello world ${t}"
>
> bash output:
> at line 5
> at line 7
> at line 7
> at line 7
> at line 7
> at line 7
> at line 7
> at line 7
> at line 7
> at line 7
> at line 7
> at line 10
> hello world 10
>
> hush output:
> at line 5
> at line 9
> at line 9
> at line 9
> at line 9
> at line 9
> at line 9
> at line 9
> at line 9
> at line 9
> at line 9
> at line 10
> hello world 10
>
> all the line 9 prints are the print within the loop.
>
> any ideas why?

Care to send the patch?


More information about the busybox mailing list