From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Cc: Devin Hussey <husseydevin@gmail.com>
Subject: Re: NO_CASE_GLOB and unreadable directories (Episode VI: A New Hope)
Date: Thu, 14 Jan 2021 10:56:57 -0800 [thread overview]
Message-ID: <CAH+w=7bj5wSorD73m8SBABsieKG2KP0PYPKbszWTj7_1syDkSQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Y5UQDd7Xn6g9MR_oYtDFw8S-2WpX7xEehPZ9y47=ex8w@mail.gmail.com>
On Wed, Jan 13, 2021 at 9:57 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> This is not yet suitable for folding into the master branch, because
> it is a significant change to the current zsh behavior
Found another problem with it: CASEGLOB was being applied to patterns
in other contexts.
Fixed patch below (gmail is almost certainly going to line-wrap this
one, but since so far it's for discussion only, I'm not terribly
concerned):
diff --git a/Src/pattern.c b/Src/pattern.c
index c7c2c8bea..3d282b533 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -509,10 +509,7 @@ void
patcompstart(void)
{
patcompcharsset();
- if (isset(CASEGLOB))
- patglobflags = 0;
- else
- patglobflags = GF_IGNCASE;
+ patglobflags = 0;
if (isset(MULTIBYTE))
patglobflags |= GF_MULTIBYTE;
}
@@ -632,6 +629,12 @@ patcompile(char *exp, int inflags, char **endexp)
p->patmlen = len;
p->patnpar = patnpar-1;
+ if ((patflags & PAT_FILE) && !isset(CASEGLOB) && !(patflags & PAT_PURES)) {
+ /* Special __CYGWIN__ handling needed? */
+ p->globflags |= GF_IGNCASE;
+ p->globend |= GF_IGNCASE;
+ }
+
if (!strp) {
pscan = (Upat)(patout + startoff);
next prev parent reply other threads:[~2021-01-14 18:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 3:04 [PATCH] Allow globbing with unreadable parent directories Devin Hussey
2021-01-13 22:27 ` Bart Schaefer
2021-01-14 0:27 ` Devin Hussey
2021-01-14 1:32 ` Lawrence Velázquez
2021-01-14 2:22 ` Devin Hussey
2021-01-14 2:24 ` Devin Hussey
2021-01-17 17:22 ` Daniel Shahaf
2021-01-17 18:02 ` Bart Schaefer
2021-01-17 18:23 ` Bart Schaefer
2021-01-14 4:04 ` Bart Schaefer
2021-01-14 5:57 ` NO_CASE_GLOB and unreadable directories (Episode VI: A New Hope) Bart Schaefer
2021-01-14 18:56 ` Bart Schaefer [this message]
2021-01-25 0:52 ` Bart Schaefer
2021-01-25 14:05 ` Peter Stephenson
2021-02-05 5:53 ` Bart Schaefer
2021-02-06 12:31 ` Daniel Shahaf
2021-03-27 17:31 ` Lawrence Velázquez
2021-04-10 20:56 ` Lawrence Velázquez
2021-04-10 21:22 ` Bart Schaefer
2021-04-13 11:46 ` Daniel Shahaf
2021-04-13 21:33 ` 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='CAH+w=7bj5wSorD73m8SBABsieKG2KP0PYPKbszWTj7_1syDkSQ@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=husseydevin@gmail.com \
--cc=zsh-workers@zsh.org \
/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).