From: Tom Rini Date: Tue, 4 Feb 2014 17:06:25 -0500 Subject: [U-Boot] [PATCH V4 05/12] cmd_test: check for binary operators before unary In-Reply-To: <1391458870-17930-5-git-send-email-swarren@wwwdotorg.org> References: <1391458870-17930-1-git-send-email-swarren@wwwdotorg.org> <1391458870-17930-5-git-send-email-swarren@wwwdotorg.org> Message-ID: <20140204220625.GQ7049@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Feb 03, 2014 at 01:21:03PM -0700, Stephen Warren wrote: > From: Stephen Warren > > This better mirrors the behaviour of bash, for example: > > $ if test -z = -z; then echo yes; else echo no; fi > yes > > This is parsed as a string comparison of "-z" and "-z", since the check > for the binary "=" operator occurs first. Without this change, the > command would be parsed as a -z test of "-", followed by a syntax error; > a trailing -z without and operand. > > This is a behavioural change, but I believe any commands affected were > previously invalid or bizarely formed. > > Signed-off-by: Stephen Warren Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: