Busybox `xargs -I`- ignore empty lines

Denys Vlasenko vda.linux at googlemail.com
Tue Sep 29 22:03:45 UTC 2020


Thanks for the bug report. Fixed in a bit different way.
Please try current git,

On Wed, Sep 23, 2020 at 11:46 AM Franciszek Koltuniuk
<franciszek.koltuniuk at consult.red> wrote:
>
> Hi All,
>  Please find in attachment a new patch that replace a fix for a bug :
>
> "echo -n | xargs -I% echo %" would SEG
>
> Commit:
> https://git.busybox.net/busybox/commit/findutils/xargs.c?id=6d777b75ed322ea5ef0d1674ddfee1b5713cb04f
>
> Currently available solution fixes SEGV issue, but the execution of
> 'xargs -I' behavior is different than the xargs from (GNU findutils).
>
> Please see the example:
> ~$ cat ~/tmp/xargs-test
> --- start file xargs-test ---
>
> line number 2
>
> line number 4
>
>
> --- end file xargs-test ---
>
> * output from xargs (GNU findutils) 4.7.0:
>
> ~$ cat ~/tmp/xargs-test | /usr/bin/xargs -I % echo %
> line number 2
> line number 4
> ~$
>
> * output xargs from BusyBox v1.30.1 (Ubuntu 1:1.30.1-4ubuntu6.1)
> multi-call binary):
>
> ~$ cat ~/tmp/xargs-test | busybox xargs -I % echo %echo %
> ~$
>
> I thing that xargs from GNY findutils is expected. The patch:
>  0001-busybox-xargs-I-ignore-empty-lines.patch
> remove the changes within the commit
> 6d777b75ed322ea5ef0d1674ddfee1b5713cb04f and introduce new behavior -
> empty lines are ignored.
>
> Regards,
>  Franciszek
>
> --
> Franciszek Koltuniuk
> w:      consult.red <https://consult.red>
> e:      franciszek.koltuniuk at consult.red
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list