From 99bf0333098dd093f7ce73c84ace002e09b169cc Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Thu, 7 Nov 2013 09:23:18 +1000 Subject: Improve file copy -force identical file check On mingw we can't rely on dev+ino check Signed-off-by: Steve Bennett --- tclcompat.tcl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tclcompat.tcl b/tclcompat.tcl index d736859..fda1234 100644 --- a/tclcompat.tcl +++ b/tclcompat.tcl @@ -135,9 +135,14 @@ proc {file copy} {{force {}} source target} { error "error copying \"$source\" to \"$target\": file already exists" } # If source and target are the same, nothing to do + if {$source eq $target} { + return + } + # Hard linked, or case-insensitive filesystem + # Note: mingw returns ino=0 for every file :-( file stat $source ss file stat $target ts - if {$ss(dev) == $ts(dev) && $ss(ino) == $ts(ino)} { + if {$ss(dev) == $ts(dev) && $ss(ino) == $ts(ino) && $ss(ino)} { return } } -- cgit v1.1