summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclIO.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index b3b62ed..bf3f543 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -8175,32 +8175,14 @@ Tcl_SetChannelOption(
UpdateInterest(chanPtr);
return TCL_OK;
} else if (HaveOpt(2, "-eofchar")) {
- if (!newValue[0] || (!(newValue[0] & 0x80) && !newValue[1])) {
- if (GotFlag(statePtr, TCL_READABLE)) {
- statePtr->inEofChar = newValue[0];
- }
+ if (!newValue[0] || (!(newValue[0] & 0x80) && (!newValue[1]
#ifndef TCL_NO_DEPRECATED
- } else if (Tcl_SplitList(interp, newValue, &argc, &argv) == TCL_ERROR) {
- return TCL_ERROR;
- } else if (argc == 0) {
- statePtr->inEofChar = 0;
- } else if (argc == 1 || argc == 2) {
- int inValue = (int) argv[0][0];
- int outValue = (argc == 2) ? (int) argv[1][0] : 0;
-
- if (inValue & 0x80 || (inValue && argv[0][1]) || outValue) {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "bad value for -eofchar: must be non-NUL ASCII"
- " character", -1));
- }
- Tcl_Free((void *)argv);
- return TCL_ERROR;
- }
+ || !strcmp(newValue+1, " {}")
+#endif
+ ))) {
if (GotFlag(statePtr, TCL_READABLE)) {
- statePtr->inEofChar = inValue;
+ statePtr->inEofChar = newValue[0];
}
-#endif
} else {
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(