diff options
author | dkf <dkf@noemail.net> | 2004-05-19 22:50:22 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2004-05-19 22:50:22 (GMT) |
commit | bb8eef6c36760fea525446ef941f69b380015392 (patch) | |
tree | 0bb59a47ae445dec3d0a2828d8bad3f379cf84b7 /win/tclWinFile.c | |
parent | ba0297b9f7d0811970f9559e9f2c6e2024cf2b70 (diff) | |
download | tcl-bb8eef6c36760fea525446ef941f69b380015392.zip tcl-bb8eef6c36760fea525446ef941f69b380015392.tar.gz tcl-bb8eef6c36760fea525446ef941f69b380015392.tar.bz2 |
Backport of bizarre error-loss bug found by KBK and myself.
FossilOrigin-Name: 6a6612227df074ff263f0f89a6a68868cce96851
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r-- | win/tclWinFile.c | 7 |
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 |