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

Re: zsh: RM_STAR warning counts files as though DOT_GLOB is set

Forwarding from Debian:

Daniel Shahaf wrote on Mon, 11 Sep 2017 15:07 +0000:
> $ zsh -f
> % cd $(mktemp -d)
> % touch ./foo ./.bar 
> % rm *
> zsh: sure you want to delete all 2 files in /tmp/tmp.65xnqgzMAY [yn]? y
> % 
> % ls -A
> .bar
> zsh-5.4.2-1-gab6ac7313

The problem is that it says "2 files" but only one file is deleted.

The impedance mismatch is that checkrmall() calls zreaddir(...,
unset(GLOBDOTS)), but the second actual argument to zreaddir() governs
whether the dot and dot-dot entries would be excluded.  Instead,
checkrmall() should pass true for the second argument of zreaddir(),
and dotfiles should be ignored by some other means when ignoredots is true.
(I've just added a docstring to zreaddir() to close the barn door.)

I don't understand the last branch of the if/else in that function: it seems to
prompt "... delete all the files ..." when count == 0?



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