zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk
Subject: Re: path and += troubles
Date: Sun, 27 Nov 2005 20:39:50 +0000	[thread overview]
Message-ID: <200511272039.jARKdohO003868@pwslaptop.csr.com> (raw)
In-Reply-To: Your message of "Sun, 27 Nov 2005 18:40:48 GMT." <1051127184048.ZM7959@candle.brasslantern.com>

Bart Schaefer wrote:
> Starting from "zsh -f":
> 
> zagzig% setopt cshnullglob
> zagzig% echo $1+=($2)
> zsh: no match
> zagzig% $1+=($2)
> zagzig% 
> 
> The problem of course is that cshnullglob is supposed to be like nomatch
> if *nothing* matches -- it's only supposed to be like nullglob if at
> least one of several patterns matches.

The first argument is globbed separately in order to check whether its
arguments require special expansion, via a direct call to zglob() rather
than globlist() which is where cshnullglob is handled.  Even if the flag
had been set, if globlist() were later called for other arguments the
flag would be reset.

Does applying cshnullglob to the command word and its argument list
together make sense?  It would mean you were happy for any of the
expansions to give you the command to run.  I suppose that's just
conceivable.  This would need fixing up around execcmd() by separating
out the cshnullglob handling from globlist(), though we still need the
current form of handling in globlist() for other uses like array
assignments... not very pretty.

> I originally [in the -users thread] mentioned that the error message
> vanishes with either nullglob or cshnullglob.  After I figured out that
> it happens because the test string I was using was somehow a valid glob
> qualifier -- that is, "(2)" is a valid qualifier, though I have no idea
> what meaning it can possibly have -- then I said [on -workers] that it
> was limited to cshnullglob.

Looks like it means an octal mode: try *(644).  I have no idea where
this came from; it doesn't appear to be documented.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page still at http://www.pwstephenson.fsnet.co.uk/


  reply	other threads:[~2005-11-27 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1051126170046.ZM773@candle.brasslantern.com>
2005-11-26 18:40 ` Peter Stephenson
2005-11-26 21:13   ` Bart Schaefer
2005-11-27 13:34     ` Peter Stephenson
2005-11-27 18:40       ` Bart Schaefer
2005-11-27 20:39         ` Peter Stephenson [this message]
2005-11-28  1:15           ` Bart Schaefer

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=200511272039.jARKdohO003868@pwslaptop.csr.com \
    --to=p.w.stephenson@ntlworld.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).