parameter expansion with uninitialized variable

Denys Vlasenko vda.linux at googlemail.com
Sat Jan 9 07:30:37 UTC 2021


Indeed. Fixed in git just now.

On Fri, Jan 8, 2021 at 9:53 PM Christian Hesse <list at eworm.de> wrote:
>
> Hello everybody,
>
> with busybox 1.32 shell's parameter expansion starts to fail with
> uninitialized variables.
>
> Set a variable and echo, replacing comma with space:
>
> ~ $ test=abc,def
> ~ $ echo ${test/,/ }
> abc def
> ~ $
>
> Even with empty variable this works. Well, brings expected result:
>
> ~ $ test=
> ~ $ echo ${test/,/ }
>
> ~ $
>
> But unsetting the variable results in echoing a slash:
>
> ~ $ unset test
> ~ $ echo ${test/,/ }
> /
> ~ $
>
> This worked as expected with busybody 1.31. Sadly bisecting did not reveal
> any results as I was facing build errors with most revisions.
> --
> main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
> "CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
> putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list