Re: Field splitting regression on master branch

Harald van Dijk <[email protected]>
Newsgroups org.kernel.vger.dash
Message-ID <[email protected]>
On 21/06/2024 02:33, Martijn Dekker wrote:
> As of commit c0674f487c7aec2a3bdf6795cea7e60c9530c360, field splitting 
> is broken. Minimal-ish reproducer:
> 
> $ dash -c 'IFS=:; v=" :: :: "; set $v; echo $#'
> 5
> 
> Expected output: 2

This results in 5 in bash, ksh, older dash, yash, everything I can think 
to test. Whitespace IFS characters is meant to be handled differently 
from non-whitespace IFS characters, I think 5 is the correct result.

But with IFS=": " instead of IFS=:, the output was previously 4, is 
supposed to be 4, and has changed to 2; I agree that it looks like dash 
has introduced a bug here.

Cheers,
Harald van Dijk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.