diff options
author | dgp <dgp@users.sourceforge.net> | 2013-03-19 14:39:09 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-03-19 14:39:09 (GMT) |
commit | c310129d42dd35b9a5fc585d1b0d93e6656c2a97 (patch) | |
tree | 53e23d7d1a1023caf48795d602365a796ad8c3be | |
parent | 23b102e5e8516ffc7195aaf14a008383ffbcb69d (diff) | |
parent | c82a99d9c150ac245f6d3e1131ff7babdda85ea0 (diff) | |
download | tcl-c310129d42dd35b9a5fc585d1b0d93e6656c2a97.zip tcl-c310129d42dd35b9a5fc585d1b0d93e6656c2a97.tar.gz tcl-c310129d42dd35b9a5fc585d1b0d93e6656c2a97.tar.bz2 |
3597000 Consistent [file copy] result.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclFCmd.c | 17 | ||||
-rw-r--r-- | tests/fileSystem.test | 4 |
3 files changed, 14 insertions, 12 deletions
@@ -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 3608360]: Incompatible behaviour of "file diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index 33c1496..13377d3 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -734,17 +734,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 972c611..942a86c 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -641,7 +641,7 @@ test filesystem-7.4 {cross-filesystem file copy with -force} -setup { file delete -force simplefile file delete -force file2 cd $dir -} -result {0 10 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 10 1} +} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 {} 1} test filesystem-7.5 {cross-filesystem file copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] @@ -666,7 +666,7 @@ test filesystem-7.5 {cross-filesystem file copy with -force} -setup { file delete -force simplefile file delete -force file2 cd $dir -} -result {0 10 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 10 1} +} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 {} 1} test filesystem-7.6 {cross-filesystem dir copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] |