1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-01 19:41:00 +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

@ -1,5 +1,8 @@
2007-05-14 Peter Stephenson <pws@csr.com>
* users/11484: Functions/Misc/zmv: allow renaming $f to $g
to work if the files are really the same.
* 23438 (slightly improved to use _call_program):
Completion/Unix/Type/_printers: improve finding of network
printers.

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