summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-04-15 17:34:23 (GMT)
committerhobbs <hobbs>2000-04-15 17:34:23 (GMT)
commita0ff165b09d2d6332600ddc96eba95b287cfd204 (patch)
treed05c7b287a2f75af4d1e2e5e3cfbfefaf0cc86ca
parentd41d5cc057126f0420acc1ce8ce30b60fe8cf709 (diff)
downloadtcl-a0ff165b09d2d6332600ddc96eba95b287cfd204.zip
tcl-a0ff165b09d2d6332600ddc96eba95b287cfd204.tar.gz
tcl-a0ff165b09d2d6332600ddc96eba95b287cfd204.tar.bz2
* unix/tclUnixChan.c (TtyParseMode): Only allow setting mark/space
parity on platforms that support it [Bug: 5089]
-rw-r--r--unix/tclUnixChan.c21
1 files 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;
}