summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclFCmd.c17
-rw-r--r--tests/fileSystem.test4
3 files changed, 14 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fef3c3..0d17957 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-19 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclFCmd.c: [Bug 3597000] Consistent [file copy] result.
+ * tests/fileSystem.test:
+
2013-03-19 Jan Nijtmans <nijtmans@users.sf.net>
* win/tclWinFile.c: [Bug 2893771]: file stat fails on locked files
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index c59fb54..93ccfd7 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -742,17 +742,14 @@ CopyRenameOneFile(
*/
errfile = target;
-
- /*
- * We now need to reset the result, because the above call, if it
- * failed, may have put an error message in place. (Ideally we
- * would prefer not to pass an interpreter in above, but the
- * channel IO code used by TclCrossFilesystemCopy currently
- * requires one).
- */
-
- Tcl_ResetResult(interp);
}
+ /*
+ * We now need to reset the result, because the above call,
+ * may have left set it. (Ideally we would prefer not to pass
+ * an interpreter in above, but the channel IO code used by
+ * TclCrossFilesystemCopy currently requires one)
+ */
+ Tcl_ResetResult(interp);
}
if ((copyFlag == 0) && (result == TCL_OK)) {
if (S_ISDIR(sourceStatBuf.st_mode)) {
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index ab3f62a..161ebc3 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -827,7 +827,7 @@ test filesystem-7.4 {cross-filesystem file copy with -force} testsimplefilesyste
file delete -force file2
cd $dir
set res
-} {0 10 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 10 1}
+} {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 {} 1}
test filesystem-7.5 {cross-filesystem file copy with -force} {testsimplefilesystem unix} {
set dir [pwd]
cd [tcltest::temporaryDirectory]
@@ -851,7 +851,7 @@ test filesystem-7.5 {cross-filesystem file copy with -force} {testsimplefilesyst
file delete -force file2
cd $dir
set res
-} {0 10 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 10 1}
+} {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 {} 1}
test filesystem-7.6 {cross-filesystem dir copy with -force} testsimplefilesystem {
set dir [pwd]
cd [tcltest::temporaryDirectory]