mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-03 20:20:56 +02:00
11484: allow zmv to rename to equivalent but differently named files
This commit is contained in:
parent
a8d47caea1
commit
a11fbaf68c
2 changed files with 5 additions and 7 deletions
|
@ -1,5 +1,8 @@
|
||||||
2007-05-14 Peter Stephenson <pws@csr.com>
|
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):
|
* 23438 (slightly improved to use _call_program):
|
||||||
Completion/Unix/Type/_printers: improve finding of network
|
Completion/Unix/Type/_printers: improve finding of network
|
||||||
printers.
|
printers.
|
||||||
|
|
|
@ -262,13 +262,8 @@ for f in $files; do
|
||||||
continue
|
continue
|
||||||
elif [[ -n $from[$g] && ! -d $g ]]; then
|
elif [[ -n $from[$g] && ! -d $g ]]; then
|
||||||
errs=($errs "$f and $from[$g] both map to $g")
|
errs=($errs "$f and $from[$g] both map to $g")
|
||||||
elif [[ -f $g && -z $opt_f ]]; then
|
elif [[ -f $g && -z $opt_f && ! ($f -ef $g && $action = mv) ]]; then
|
||||||
if [[ $f != $g && $f -ef $g ]]; then
|
errs=($errs "file exists: $g")
|
||||||
errs=($errs "file exists: $g
|
|
||||||
(Probably the same file, owing to file system limitations.)")
|
|
||||||
else
|
|
||||||
errs=($errs "file exists: $g")
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
from[$g]=$f
|
from[$g]=$f
|
||||||
to[$f]=$g
|
to[$f]=$g
|
||||||
|
|
Loading…
Reference in a new issue