Re: expand: Fix ghost fields with unquoted $@/$*

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

 



On 23/03/2018 13:20, Herbert Xu wrote:
On Fri, Mar 23, 2018 at 12:19:28PM +0100, Harald van Dijk wrote:

Right.  I think I'll leave this one alone.  It worked purely by
chance previously because dash incorrectly used the first IFS
character even when it's outside of double-quotes, which is why
the expansion ${@%2 C3} matches.

When the first IFS character is a whitespace character, which it usually is,
it's not incorrect: inserting that character and then splitting on it
produces the exact results that POSIX requires. It's only when IFS doesn't
start with a whitespace character that it's incorrect.

Where does POSIX require this?

It doesn't, and I didn't say it did. POSIX doesn't care how it's implemented, POSIX cares about the results produced. When another approach produces the same results, both approaches are equally correct.

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