From: Oliver Freyermuth <o.freyermuth@googlemail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: zsh expansion fails if nocaseglob and not all directory components are listable
Date: Mon, 22 Aug 2022 23:36:21 +0200 [thread overview]
Message-ID: <866908c4-1b30-9e23-92ab-6221d911815b@googlemail.com> (raw)
In-Reply-To: <CAH+w=7aOb-nCtz0xt5PW=L1AdUoc6F6fxejj5j_OZftTfm0O5w@mail.gmail.com>
Hi Bert,
Am 22.08.22 um 22:59 schrieb Bart Schaefer:
> On Mon, Aug 22, 2022 at 1:15 PM Lawrence Velázquez <larryv@zsh.org> wrote:
>>
>> This behavior is known; see the discussions rooted at workers/47813
>> (https://www.zsh.org/mla/workers/2021/msg00026.html) and workers/47822
>> (https://www.zsh.org/mla/workers/2021/msg00035.html), and possibly
>> others I'm not aware of. I don't remember if any of the proposed
>> changes were accepted.
>
> 47913: implement CASE_PATHS option to make NO_CASE_GLOB more sensible
>
> This was included in the 5.9 release.
>
> The NEWS file says:
>
> The option CASE_PATHS was added to control how NO_CASE_GLOB behaves.
> NO_CASE_GLOB + NO_CASE_PATHS is equivalent to the current NO_CASE_GLOB
> behaviour. NO_CASE_GLOB + CASE_PATHS treats only path components that
> contain globbing characters as case-insensitive; this behaviour may
> yield more predictable results on case-sensitive file systems.
> NO_CASE_PATHS is the default.
thanks! And also thanks to all others, I agree (after the examples outlined by Daniel) there is no simple way out, but a new option seems to be the most sensible approach.
Sadly, it does not seem to change the described case, using:
zsh --version
zsh 5.9 (x86_64-pc-linux-gnu)
I get:
1) Prepare directory:
mkdir foo
chmod 711 foo
mkdir foo/test
sudo chown root:root foo
cd foo/test
2) Test with caseglob:
setopt caseglob
echo $(pwd)(N)
=> Output is returned just fine.
3) Test with nocaseglob:
setopt nocaseglob
echo $(pwd)(N)
=> No output is returned (expected).
4) Test with nocaseglob and casepaths:
set nocaseglob
set casepaths
echo $(pwd)(N)
=> Also here, no output is returned. The path componend which can not be listed is "foo" which does not have any globbing characters inside.
I presume it fails since it still attempts to list the directory, which fails, before the actual matching is performed?
Cheers and thanks,
Oliver
next prev parent reply other threads:[~2022-08-22 21:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 18:02 Oliver Freyermuth
2022-08-22 19:05 ` Daniel Shahaf
2022-08-22 20:14 ` Lawrence Velázquez
2022-08-22 20:59 ` Bart Schaefer
2022-08-22 21:36 ` Oliver Freyermuth [this message]
2022-08-22 21:56 ` Dominik Vogt
2022-08-22 22:01 ` Oliver Freyermuth
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=866908c4-1b30-9e23-92ab-6221d911815b@googlemail.com \
--to=o.freyermuth@googlemail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-users@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).