diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-31 19:20:43 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-31 19:21:51 +0200 |
commit | 78b1b1b07ac2784f67bc65bb1d86cc2559a12446 (patch) | |
tree | d2cd92f90441ad5799381cec6a27f6ac88100cdc /Makefile.help | |
parent | cee603d921594fc779bc26a200dfb010cd62ab92 (diff) | |
download | busybox-78b1b1b07ac2784f67bc65bb1d86cc2559a12446.tar.gz |
test: fix 4-argument case
Upstream dash commit:
Date: Sun, 13 Jul 2008 19:20:10 +0800
Fixed 3,4-argument cases for test per POSIX
----- Forwarded message from Gerrit Pape <pape@smarden.org> -----
Subject: Bug#455828: dash: 4-argument test "test \( ! -e \)" yields an error
Date: Fri, 28 Dec 2007 08:53:29 +0000
From: Gerrit Pape <pape@smarden.org>
To: Vincent Lefevre <vincent@vinc17.org>, 455828@bugs.debian.org
On Thu, Dec 27, 2007 at 06:23:20PM +0100, Vincent Lefevre wrote:
> On 2007-12-27 16:00:06 +0000, Gerrit Pape wrote:
> > On Wed, Dec 12, 2007 at 02:18:47AM +0100, Vincent Lefevre wrote:
> > > According to POSIX[*], "test \( ! -e \)" is a 4-argument test and is
> > > here equivalent to "test ! -e". But dash (like ksh93 and bash) yields
> > > an error:
> > >
> > > $ test \( ! -e \) || echo $?
> > > test: 1: closing paren expected
> > > 2
> > > $ test ! -e || echo $?
> > > 1
> >
> > Hi Vincent,
> >
> > the -e switch to test takes an argument, a pathname.
>
> According to POSIX, in both above examples, "-e" is *not* a switch,
> just a string.
>
> test \( ! -e \)
>
> means: return true if the string "-e" is empty, otherwhise return false.
> The error in dash is that it incorrectly thinks that "-e" is a switch in
> this context.
I see, you're right. Thanks, Gerrit.
----- End forwarded message -----
This patch hard-codes the 3,4-argument cases in the way required by
POSIX.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
function old new delta
test_main 370 421 +51
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'Makefile.help')
0 files changed, 0 insertions, 0 deletions