Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh expansion fails if nocaseglob and not all directory components are listable



Dear zsh'ers,

I'm not sure if this is a bug or a feature — but I have seen some zsh scripts break when the top level home directory (/home) is set to mode 711 and owned by root
(as is common for shared home directories offered via network at our site), when nocaseglob is active.

To reproduce locally, see the following example:

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.

Of course, zsh can not exclude there are other directories directly inside "foo/" matching the given pattern (but with different case) since "foo/" can not be listed. However, at least the explicit match with case is known,
so I'm astonished zero matches are returned.

Is this expected, or a bug?

Cheers,
	Oliver


Messages sorted by: Reverse Date, Date, Thread, Author