1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 04:30:24 +02:00

11484: allow zmv to rename to equivalent but differently named files

This commit is contained in:
Peter Stephenson 2007-05-14 17:58:57 +00:00
parent a8d47caea1
commit a11fbaf68c
2 changed files with 5 additions and 7 deletions

View file

@ -262,13 +262,8 @@ for f in $files; do
continue
elif [[ -n $from[$g] && ! -d $g ]]; then
errs=($errs "$f and $from[$g] both map to $g")
elif [[ -f $g && -z $opt_f ]]; then
if [[ $f != $g && $f -ef $g ]]; then
errs=($errs "file exists: $g
(Probably the same file, owing to file system limitations.)")
else
errs=($errs "file exists: $g")
fi
elif [[ -f $g && -z $opt_f && ! ($f -ef $g && $action = mv) ]]; then
errs=($errs "file exists: $g")
fi
from[$g]=$f
to[$f]=$g