Re: dash: read does not ignore trailing spaces

2016-01-29 Thread Martijn Dekker
Harald van Dijk schreef op 04-12-15 om 19:51: > Here it is. Attached is an updated patch that ignores the complete > terminator if only a single field remains, otherwise ignores only > trailing IFS whitespace. I've tested the patch and it looks like it fixes the bug nicely. With the patch, dash

Re: dash: read does not ignore trailing spaces

2015-12-04 Thread Harald van Dijk
On 03/12/2015 23:26, Harald van Dijk wrote: On 03/12/2015 22:17, Stephane Chazelas wrote: 2015-12-03 22:02:14 +0100, Harald van Dijk: [] $ for shell in bash mksh posh zsh; do printf %s: "$shell"; $shell -c 'IFS=,; echo a, | { read v; echo "<$v>"; }'; done bash: mksh: posh:

Re: dash: read does not ignore trailing spaces

2015-12-03 Thread Harald van Dijk
On 03/12/2015 22:17, Stephane Chazelas wrote: 2015-12-03 22:02:14 +0100, Harald van Dijk: [] $ for shell in bash mksh posh zsh; do printf %s: "$shell"; $shell -c 'IFS=,; echo a, | { read v; echo "<$v>"; }'; done bash: mksh: posh: zsh: As far as I can tell, the

Re: dash: read does not ignore trailing spaces

2015-12-03 Thread Harald van Dijk
On 02/12/2015 23:37, Gioele Barabucci wrote: Hello, I am forwarding a bug [1] reported by a Debian user: `read` does not ignore trailing spaces. The current version of dash is affected by this bug. A simple test from the original reporter: $ dash -c 'echo " a b " | { read v ; echo

Re: dash: read does not ignore trailing spaces

2015-12-03 Thread Stephane Chazelas
2015-12-03 23:17:58 +, Stephane Chazelas: > 2015-12-03 23:04:31 +, Stephane Chazelas: > [...] > > > Summarising: POSIX states that "each occurrence in the input of an IFS > > > character that is not IFS white space, along with any adjacent IFS white > > > space, shall delimit a field".