From a11fbaf68c2bf81424c1ca8381e2043b5b56711b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 14 May 2007 17:58:57 +0000 Subject: 11484: allow zmv to rename to equivalent but differently named files --- ChangeLog | 3 +++ Functions/Misc/zmv | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37daf3cdd..4615da3da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-14 Peter Stephenson + * 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. diff --git a/Functions/Misc/zmv b/Functions/Misc/zmv index 553579232..e85b0b5ae 100644 --- a/Functions/Misc/zmv +++ b/Functions/Misc/zmv @@ -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 -- cgit v1.2.3