bug#23222: test: incorrect operator-precedence

2018-10-29 Thread Assaf Gordon
tags 23222 fixed close 23222 stop On 2016-04-05 9:09 a.m., Eric Blake wrote: tag 23222 confirmed thanks On 04/05/2016 05:57 AM, Mattias Andrée wrote: Failing test-case #1: ./test -n -a -n fails and outputs ./test: extra argument ‘-n’ Expected behaviour is silent success, as seen in Bash

bug#23222: test: incorrect operator-precedence

2016-04-05 Thread Eric Blake
On 04/05/2016 12:36 PM, Mattias Andrée wrote: >> Sorry, but here, you're wrong. POSIX states: >> >> "4 arguments: >> If $1 is '!', negate the three-argument test of >> $2, $3, and $4." >> >> which means this parses as: >> >> test ! \( '' -a '' \) >> > > XSI-conformant systems shall use

bug#23222: test: incorrect operator-precedence

2016-04-05 Thread Mattias Andrée
On Tue, 5 Apr 2016 09:09:40 -0600 Eric Blake wrote: > tag 23222 confirmed > thanks > > On 04/05/2016 05:57 AM, Mattias Andrée wrote: > > Failing test-case #1: > > > > ./test -n -a -n > > > > fails and outputs > > > > ./test: extra argument ‘-n’ > > > > Expected behaviour is silent success,

bug#23222: test: incorrect operator-precedence

2016-04-05 Thread Eric Blake
tag 23222 confirmed thanks On 04/05/2016 05:57 AM, Mattias Andrée wrote: > Failing test-case #1: > > ./test -n -a -n > > fails and outputs > > ./test: extra argument ‘-n’ > > Expected behaviour is silent success, as seen in > Bash's implementation. Thanks for the report. POSIX indeed says

bug#23222: test: incorrect operator-precedence

2016-04-05 Thread Mattias Andrée
Failing test-case #1: ./test -n -a -n fails and outputs ./test: extra argument ‘-n’ Expected behaviour is silent success, as seen in Bash's implementation. Explanation: -a has higher precedence than -n. Therefore the test is equivalent to ./test -n && ./test -n. ./test -n shall succeed becau