zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Cc: DervishD <raul@viadomus.com>
Subject: Re: About 'test' compatibility
Date: Wed, 27 Feb 2002 21:47:43 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0202272144350.31219-100000@ns1.sodaware.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0202261404420.14523-100000@ns1.sodaware.com>

On Tue, 26 Feb 2002, Bart Schaefer wrote:

> > >No, it's the -d in $DEFAULT that's confusing it.  When $DEFAULT is
> > >-d, zsh is treating the above as "if there is a directory named `='
> > >..."
>
> It appears that bash gives the infix '=' higher precedence than the prefix
> '-d' or the infix '-a'

This really is a bug in zsh.  `[ -d = -d ]' is correctly parsed as an
infix `=' comparison, but `[ -d = -d anything ... ]' is not.

Does anybody know why the parser cares about !testargs[2] in the fragment
below?  Everything seems to work fine with it commented out.

Index: parse.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/parse.c,v
retrieving revision 1.11
diff -c -r1.11 parse.c
--- parse.c	2002/01/07 15:18:23	1.11
+++ parse.c	2002/02/28 05:40:49
@@ -1859,7 +1859,7 @@
 	    condlex();
 	    return par_cond_double(dupstring("-n"), s1);
 	}
-	if (testargs[1] && !testargs[2]) {
+	if (testargs[1] /* && !testargs[2] */) {
 	    /* three arguments: if the second argument is a binary operator, *
 	     * perform that binary test on the first and the trird argument  */
 	    if (!strcmp(*testargs, "=")  ||



      parent reply	other threads:[~2002-02-28  5:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-26 20:07 DervishD
2002-02-26 20:16 ` Bart Schaefer
2002-02-26 20:28   ` DervishD
2002-02-26 21:33     ` Bart Schaefer
2002-02-26 21:39       ` DervishD
2002-02-26 22:17         ` Bart Schaefer
2002-02-27 10:36           ` DervishD
2002-02-28  5:47           ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0202272144350.31219-100000@ns1.sodaware.com \
    --to=schaefer@brasslantern.com \
    --cc=raul@viadomus.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).