Re: [PATCH 6/7] syntax-check: fix violations and implement sc_prohibit_test_const_follows_var.

2011-11-22 Thread Stefano Lattarini
[adding bug-autoconf in CC] On Tuesday 22 November 2011, Gary V wrote: Hi Eric, On 22 Nov 2011, at 03:07, Eric Blake wrote: On 11/21/2011 07:47 AM, Gary V. Vaughan wrote: To safely use a non-literal first argument to `test', you must always prepend a literal non-`-' character, but

Re: [PATCH 6/7] syntax-check: fix violations and implement sc_prohibit_test_const_follows_var.

2011-11-22 Thread Eric Blake
On 11/22/2011 02:02 AM, Stefano Lattarini wrote: test a = $b is just as likely to trigger improper evaluation in buggy test(1) implementations as: test $b = a :-o For real? On non-museum pieces? Okay, you've convinced me otherwise. It looks like even buggy versions of test(1) at least

Re: [PATCH 6/7] syntax-check: fix violations and implement sc_prohibit_test_const_follows_var.

2011-11-22 Thread Stefano Lattarini
On Tuesday 22 November 2011, Eric Blake wrote: touch =; test -f =; echo $? This is problematic also with pdksh 5.2.14 on Debian: $ pdksh -c 'touch ./=; test -f =; echo $?' pdksh: test: =: missing second argument 2 and with /bin/sh on OpenBSD 4.6 as well: $ /bin/sh -c 'touch ./=; test

Re: [PATCH 6/7] syntax-check: fix violations and implement sc_prohibit_test_const_follows_var.

2011-11-21 Thread Eric Blake
On 11/21/2011 07:47 AM, Gary V. Vaughan wrote: To safely use a non-literal first argument to `test', you must always prepend a literal non-`-' character, but often the second operand is a constant that doesn't begin with a `-' already, so always use `test a = $b' instead of noisy `test X$b =

Re: [PATCH 6/7] syntax-check: fix violations and implement sc_prohibit_test_const_follows_var.

2011-11-21 Thread Stefano Lattarini
Hi Gary. Few more random nits... On Monday 21 November 2011, Gary V wrote: To safely use a non-literal first argument to `test', you must always prepend a literal non-`-' character, but often the second operand is a constant that doesn't begin with a `-' already, so always use `test a = $b'

Re: [PATCH 6/7] syntax-check: fix violations and implement sc_prohibit_test_const_follows_var.

2011-11-21 Thread Gary V. Vaughan
Hi Eric, On 22 Nov 2011, at 03:07, Eric Blake wrote: On 11/21/2011 07:47 AM, Gary V. Vaughan wrote: To safely use a non-literal first argument to `test', you must always prepend a literal non-`-' character, but often the second operand is a constant that doesn't begin with a `-' already, so

Re: [PATCH 6/7] syntax-check: fix violations and implement sc_prohibit_test_const_follows_var.

2011-11-21 Thread Gary V. Vaughan
Hi Stefano, On 22 Nov 2011, at 03:13, Stefano Lattarini wrote: Hi Gary. Few more random nits... Thanks ;) On Monday 21 November 2011, Gary V wrote: To safely use a non-literal first argument to `test', you must always prepend a literal non-`-' character, but often the second operand is a