summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-03-19 14:31:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-03-19 14:31:56 (GMT)
commitc82a99d9c150ac245f6d3e1131ff7babdda85ea0 (patch)
tree89b9bfaf7718af0cfa4826543888199b145667af
parent01ae22053af8cd618c105c63909fa6386f316bbc (diff)
parenta515c79f52c3d0927a7377700467074b80b8d169 (diff)
downloadtcl-c82a99d9c150ac245f6d3e1131ff7babdda85ea0.zip
tcl-c82a99d9c150ac245f6d3e1131ff7babdda85ea0.tar.gz
tcl-c82a99d9c150ac245f6d3e1131ff7babdda85ea0.tar.bz2
3597000 Consistent [file copy] result.
-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]