Re: [PATCH v3] builtin: Fix handling of trailing IFS white spaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/06/16 13:06, Herbert Xu wrote:
On Sun, Jun 12, 2016 at 12:35:15PM +0200, Harald van Dijk wrote:

The results are a lot better now, but I did spot a problem:

src/dash -c 'X="x  "; echo $X'

This is supposed to print "x\n", but the IFS breakup of $X generates
two words, one "x", one " ", meaning "x  \n" gets printed instead. I
think this is intended to get fixed up in the if (ifsspc) block, but
that block doesn't get executed when there are no more characters
after the spaces.

Weird, I can't reproduce this at all:

$ src/dash -c 'X="x "; echo $X' | cat -A
x$
$

What am I doing wrong?

It needs two spaces after the "x", not just one. With a single space, it does work right.

Cheers,
Harald van Dijk
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux