summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-05-19 22:50:22 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-05-19 22:50:22 (GMT)
commit64321856827557769e2a68ac721330f82a3c7065 (patch)
tree0bb59a47ae445dec3d0a2828d8bad3f379cf84b7 /win/tclWinFile.c
parentb3dc4ac2be00faaa212364b6d4f0c0e92b9255ac (diff)
downloadtcl-64321856827557769e2a68ac721330f82a3c7065.zip
tcl-64321856827557769e2a68ac721330f82a3c7065.tar.gz
tcl-64321856827557769e2a68ac721330f82a3c7065.tar.bz2
Backport of bizarre error-loss bug found by KBK and myself.
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c7
1 files changed, 4 insertions, 3 deletions
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