diff options
author | Kevin B Kenny <kennykb@acm.org> | 2004-05-19 22:41:20 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2004-05-19 22:41:20 (GMT) |
commit | ea59419c25449100febc3fb0ed1f7fee1b9c7e8a (patch) | |
tree | 75e643904f23a350dc38d9441b4ae1cba5bbfe4f | |
parent | ceb71f9e1a655bd89eaf50c944528c49fe812f88 (diff) | |
download | tcl-ea59419c25449100febc3fb0ed1f7fee1b9c7e8a.zip tcl-ea59419c25449100febc3fb0ed1f7fee1b9c7e8a.tar.gz tcl-ea59419c25449100febc3fb0ed1f7fee1b9c7e8a.tar.bz2 |
* 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 FindFirstFileEx 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.)
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | win/tclWinFile.c | 5 |
2 files changed, 13 insertions, 2 deletions
@@ -1,3 +1,13 @@ +2004-05-19 Kevin B. Kenny <kennykb@acm.org> + + * 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 FindFirstFileEx 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 Donal K. Fellows <donal.k.fellows@man.ac.uk> * tests/interp.test (interp-34.3): Rewrite this test to see if a diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 14c4995..e527290 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.63 2004/05/17 10:38:22 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.64 2004/05/19 22:41:22 kennykb Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -860,10 +860,10 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) FindExInfoStandard, &data, FindExSearchLimitToDirectories, NULL, 0); } - Tcl_DStringFree(&ds); if (handle == INVALID_HANDLE_VALUE) { DWORD err = GetLastError(); + Tcl_DStringFree(&ds); if (err == ERROR_FILE_NOT_FOUND) { /* * We used our 'pattern' above, and matched nothing @@ -881,6 +881,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) Tcl_DStringFree(&dsOrig); return TCL_ERROR; } + Tcl_DStringFree(&ds); /* * We may use this later, so we must restore it to its |