diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinChan.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c index e2126fb..4052e87 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinChan.c,v 1.6 1999/04/16 00:48:07 stanton Exp $ + * RCS: @(#) $Id: tclWinChan.c,v 1.7 1999/05/22 01:20:15 stanton Exp $ */ #include "tclWinInt.h" @@ -811,13 +811,23 @@ TclpOpenFileChannel(interp, fileName, modeString, permissions) } channel = TclpCreateCommandChannel(readFile, writeFile, NULL, 0, NULL); break; - case FILE_TYPE_CHAR: - default: + case FILE_TYPE_DISK: channel = TclWinOpenFileChannel(handle, channelName, channelPermissions, (mode & O_APPEND) ? FILE_APPEND : 0); break; + case FILE_TYPE_UNKNOWN: + case FILE_TYPE_CHAR: + default: + /* + * The handle is of an unknown type, probably /dev/nul equivalent + * or possibly a closed handle. Don't use it, otherwise Tk runs into + * trouble with the MS DevStudio debugger. + */ + + channel = NULL; + break; } Tcl_DStringFree(&buffer); @@ -915,11 +925,21 @@ Tcl_MakeFileChannel(rawHandle, mode) } channel = TclpCreateCommandChannel(readFile, writeFile, NULL, 0, NULL); break; - case FILE_TYPE_UNKNOWN: + + case FILE_TYPE_DISK: + channel = TclWinOpenFileChannel(handle, channelName, mode, 0); break; + + case FILE_TYPE_UNKNOWN: case FILE_TYPE_CHAR: default: - channel = TclWinOpenFileChannel(handle, channelName, mode, 0); + /* + * The handle is of an unknown type, probably /dev/nul equivalent + * or possibly a closed handle. Don't use it, otherwise Tk runs into + * trouble with the MS DevStudio debugger. + */ + + channel = NULL; break; } |