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

Re: Bug#510038: zsh: glob qualifer - doesn't work correctly on dangling symlinks



On Sun, Dec 28, 2008 at 10:41:41PM +0100, Vincent Lefevre wrote:
> The glob qualifer - doesn't work correctly on dangling symlinks.
> For instance:
> 
> $ zsh <<EOF
> set -ex
> echo $ZSH_VERSION
> mkdir globtest-dir
> cd globtest-dir
> touch file1
> chmod 644 file1
> ln -s file1 file2
> ln -s file0 file3
> ls -l file*
> ls -l file*(-W)
> EOF
> 
> gives:
> 
> +zsh:2> echo 4.3.6
> 4.3.6
> +zsh:3> mkdir globtest-dir
> +mkdir:0> mkdir globtest-dir
> +zsh:4> cd globtest-dir
> +zsh:5> touch file1
> +zsh:6> chmod 644 file1
> +zsh:7> ln -s file1 file2
> +ln:0> ln -s file1 file2
> +zsh:8> ln -s file0 file3
> +ln:0> ln -s file0 file3
> +zsh:9> ls -l file1 file2 file3
> -rw-r--r-- 1 lefevre lefevre 0 2008-12-28 22:34:28 file1
> lrwxrwxrwx 1 lefevre lefevre 5 2008-12-28 22:34:28 file2 -> file1
> lrwxrwxrwx 1 lefevre lefevre 5 2008-12-28 22:34:28 file3 -> file0
> +zsh:10> ls -l file3
> lrwxrwxrwx 1 lefevre lefevre 5 2008-12-28 22:34:28 file3 -> file0
> 
> file*(-W) should have no matches.
> 
> zsh 4.3.9 on my Mac OS X machine behaves correctly.

Are you sure? Is the stat() call succeeding on MacOS even if the
link is dangling?



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