From a0ff165b09d2d6332600ddc96eba95b287cfd204 Mon Sep 17 00:00:00 2001 From: hobbs Date: Sat, 15 Apr 2000 17:34:23 +0000 Subject: * unix/tclUnixChan.c (TtyParseMode): Only allow setting mark/space parity on platforms that support it [Bug: 5089] --- unix/tclUnixChan.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 31204cb..b0a57f5 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.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: tclUnixChan.c,v 1.14 2000/03/27 18:34:32 ericm Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.15 2000/04/15 17:34:23 hobbs Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -1132,10 +1132,25 @@ TtyParseMode(interp, mode, speedPtr, parityPtr, dataPtr, stopPtr) } return TCL_ERROR; } - if (strchr("noems", parity) == NULL) { + /* + * Only allow setting mark/space parity on platforms that support it + * [Bug: 5089] + */ + if (strchr( +#if defined(PAREXT) || defined(USE_TERMIO) + "noems", +#else + "noe", +#endif + parity) == NULL) { if (interp != NULL) { Tcl_AppendResult(interp, bad, - " parity: should be n, o, e, m, or s", NULL); +#if defined(PAREXT) || defined(USE_TERMIO) + " parity: should be n, o, e, m, or s", +#else + " parity: should be n, o, or e", +#endif + NULL); } return TCL_ERROR; } -- cgit v0.12