adding lineno implementation

Denys Vlasenko vda.linux at googlemail.com
Fri Jan 19 14:53:44 UTC 2018


On Tue, Jan 16, 2018 at 9:28 AM, daggs <daggs at gmx.com> wrote:
> Greetings Denys,
>
>> Sent: Monday, January 15, 2018 at 1:16 PM
>> From: "Denys Vlasenko" <vda.linux at googlemail.com>
>> To: daggs <daggs at gmx.com>
>> Cc: busybox <busybox at busybox.net>
>> Subject: Re: adding lineno implementation
>>
>> 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?
>>
>
> sure, see attached.


Implemented in git a bit differently


More information about the busybox mailing list