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)
commita0b87265cec0688fcea529d4afbe6397586e704b (patch)
tree89b9bfaf7718af0cfa4826543888199b145667af
parentddc36ee47351940ce5a6909c91bcda6709e5ad70 (diff)
parentd16b233ed8a81860e706a008bde82dfa568d4dcd (diff)
downloadtcl-a0b87265cec0688fcea529d4afbe6397586e704b.zip
tcl-a0b87265cec0688fcea529d4afbe6397586e704b.tar.gz
tcl-a0b87265cec0688fcea529d4afbe6397586e704b.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]