summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorstanton <stanton>1999-05-22 01:20:10 (GMT)
committerstanton <stanton>1999-05-22 01:20:10 (GMT)
commitac39508cf97576cd9747c5630c4a13d794663b4a (patch)
tree4b7c61e6c670f227cf4d603907157fb6246d2d50 /win
parent21bd132482f68735f5a4381934f56ee911904e87 (diff)
downloadtcl-ac39508cf97576cd9747c5630c4a13d794663b4a.zip
tcl-ac39508cf97576cd9747c5630c4a13d794663b4a.tar.gz
tcl-ac39508cf97576cd9747c5630c4a13d794663b4a.tar.bz2
Merged changes from scriptics-tclpro-1-3-b2 branch
Diffstat (limited to 'win')
-rw-r--r--win/tclWinChan.c30
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;
}