From e5d536c1d7d013348751b3d4b691d1fa772fe65a Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 28 Nov 2007 16:04:31 +0000 Subject: * generic/tclIO.c: Simplify test and improve accuracy of error message in latest changes. --- ChangeLog | 5 +++++ generic/tclIO.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60eaa59..f2ffb27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-28 Don Porter + + * generic/tclIO.c: Simplify test and improve accuracy of error + message in latest changes. + 2007-11-28 Pat Thoyts * generic/tclIO.c: -eofchar must support no eofchar. diff --git a/generic/tclIO.c b/generic/tclIO.c index 886a08e..5acef55 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.131 2007/11/28 01:11:52 patthoyts Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.132 2007/11/28 16:04:31 dgp Exp $ */ #include "tclInt.h" @@ -7318,11 +7318,10 @@ Tcl_SetChannelOption( int outIndex = (argc - 1); int inValue = (int) argv[0][0]; int outValue = (int) argv[outIndex][0]; - if ((inValue < 0 || inValue > 0x7f) || (outValue < 0 || outValue > 0x7f)) { + if (inValue & 0x80 || outValue & 0x80) { if (interp) { - Tcl_AppendResult(interp, - "bad value for -eofchar: must be between 0 and 0x7f", - NULL); + Tcl_AppendResult(interp, "bad value for -eofchar: ", + "must be non-NUL ASCII character", NULL); } ckfree((char *) argv); return TCL_ERROR; -- cgit v0.12