From ea59419c25449100febc3fb0ed1f7fee1b9c7e8a Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Wed, 19 May 2004 22:41:20 +0000 Subject: * 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.) --- ChangeLog | 10 ++++++++++ win/tclWinFile.c | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ceeef72..0cdcacf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-05-19 Kevin B. Kenny + + * 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 * 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 -- cgit v0.12