From: Peter Stephenson <pws@ifh.de>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: Another globbing problem
Date: Mon, 06 Sep 1999 10:10:21 +0200 [thread overview]
Message-ID: <199909060810.KAA342356@hydra.ifh.de> (raw)
In-Reply-To: "Tanaka Akira"'s message of "04 Sep 1999 08:58:24 MET DST." <rsqwvu7tun3.fsf@crane.jaist.ac.jp>
Tanaka Akira wrote:
> is27e1u11% echo ./*~./ChangeLog
> zsh: no matches found: ./*~./ChangeLog
>
> This should be:
>
> is27e1u11% echo ./*~./ChangeLog
> ./CVS ./ChangeLog.3.0 ./Completion ./Config ./Doc ./Etc ./Functions ./INSTALL
> ./META-FAQ ./Makefile ./Makefile.in ./Misc ./README ./Src ./StartupFiles ./U
> til ./acconfig.h ./aclocal.m4 ./aczsh.m4 ./config.cache ./config.guess ./conf
> ig.h ./config.h.in ./config.log ./config.status ./config.sub ./configure ./co
> nfigure.in ./install-sh ./mkinstalldirs ./stamp-h ./stamp-h.in ./status
I forgot to update the special case for a top-level ~ in globbing to
use the end character arrays.
--- Src/pattern.c~ Thu Sep 2 10:22:55 1999
+++ Src/pattern.c Mon Sep 6 09:26:06 1999
@@ -427,7 +427,7 @@
#ifdef BACKREFERENCES
int parno = 0;
#endif
- int flags, gfchanged = 0, savflags = patflags, savglobflags = patglobflags;
+ int flags, gfchanged = 0, savglobflags = patglobflags;
Upat ptr;
*flagp = 0;
@@ -491,8 +491,13 @@
up.p = NULL;
patadd((char *)&up, 0, sizeof(up), 0);
/* / is not treated as special if we are at top level */
- if (!paren)
- patflags &= ~PAT_FILE;
+ if (!paren && *patendseg == '/') {
+ tilde++;
+ patendseg++;
+ patendseglen--;
+ patendstr++;
+ patendstrlen--;
+ }
} else {
excsync = 0;
br = patnode(P_BRANCH);
@@ -529,7 +534,13 @@
}
}
newbr = patcompbranch(&flags);
- patflags = savflags;
+ if (tilde == 2) {
+ /* restore special treatment of / */
+ patendseg--;
+ patendseglen++;
+ patendstr--;
+ patendstrlen++;
+ }
if (!newbr)
return 0;
if (gfnode)
--
Peter Stephenson <pws@ifh.de> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy
prev parent reply other threads:[~1999-09-06 8:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-03 23:58 Tanaka Akira
1999-09-06 8:10 ` Peter Stephenson [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=199909060810.KAA342356@hydra.ifh.de \
--to=pws@ifh.de \
--cc=zsh-workers@sunsite.auc.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).