diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-05-19 22:50:22 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-05-19 22:50:22 (GMT) |
commit | 64321856827557769e2a68ac721330f82a3c7065 (patch) | |
tree | 0bb59a47ae445dec3d0a2828d8bad3f379cf84b7 | |
parent | b3dc4ac2be00faaa212364b6d4f0c0e92b9255ac (diff) | |
download | tcl-64321856827557769e2a68ac721330f82a3c7065.zip tcl-64321856827557769e2a68ac721330f82a3c7065.tar.gz tcl-64321856827557769e2a68ac721330f82a3c7065.tar.bz2 |
Backport of bizarre error-loss bug found by KBK and myself.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | win/tclWinFile.c | 7 |
2 files changed, 14 insertions, 3 deletions
@@ -1,3 +1,13 @@ +2004-05-19 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * win/tclWinFile.c (TclpMatchInDirectory): fix for an issue + where there was a sneak path from Tcl_DStringFree to + SetErrorCode(0). The result was that the error code could + be reset between a call to FindFirstFile and the check + of its status return, leading to a bizarre error return of + {POSIX unknown {No error}}. (Found in unplanned test - + no incident logged at SourceForge.) + 2004-05-19 Andreas Kupries <andreask@activestate.com> * tclIO.c: Fixed [SF Tcl Bug 943274]. This is the same problem as diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 6e1dde1..b29e9d1 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.7 2004/03/29 18:49:36 hobbs Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.8 2004/05/19 22:50:23 dkf Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -844,11 +844,11 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) dirName = Tcl_DStringAppend(&dirString, "*.*", 3); native = Tcl_WinUtfToTChar(dirName, -1, &ds); handle = (*tclWinProcs->findFirstFileProc)(native, &data); - Tcl_DStringFree(&ds); if (handle == INVALID_HANDLE_VALUE) { - Tcl_DStringFree(&dirString); TclWinConvertError(GetLastError()); + Tcl_DStringFree(&ds); + Tcl_DStringFree(&dirString); Tcl_ResetResult(interp); Tcl_AppendResult(interp, "couldn't read directory \"", Tcl_DStringValue(&dsOrig), "\": ", @@ -856,6 +856,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) Tcl_DStringFree(&dsOrig); return TCL_ERROR; } + Tcl_DStringFree(&ds); /* * Check to see if the pattern should match the special |