summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2004-05-19 22:41:20 (GMT)
committerKevin B Kenny <kennykb@acm.org>2004-05-19 22:41:20 (GMT)
commitea59419c25449100febc3fb0ed1f7fee1b9c7e8a (patch)
tree75e643904f23a350dc38d9441b4ae1cba5bbfe4f /win
parentceb71f9e1a655bd89eaf50c944528c49fe812f88 (diff)
downloadtcl-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.)
Diffstat (limited to 'win')
-rw-r--r--win/tclWinFile.c5
1 files changed, 3 insertions, 2 deletions
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