diff options
author | andreas_kupries <akupries@shaw.ca> | 2002-01-11 20:21:32 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2002-01-11 20:21:32 (GMT) |
commit | 5eb022d210ab41926b0be17e63347e5e864a1831 (patch) | |
tree | df1ab4f8ce92ddc51dc2f9323b60a765fe8bf2bd | |
parent | 0cfc4de959d926356cff69bb1d4ace1ceb98f96e (diff) | |
download | tcl-5eb022d210ab41926b0be17e63347e5e864a1831.zip tcl-5eb022d210ab41926b0be17e63347e5e864a1831.tar.gz tcl-5eb022d210ab41926b0be17e63347e5e864a1831.tar.bz2 |
* win/tclWinSerial.c (SerialSetOptionProc): Applied patch for SF
bug #500348 supplied by Rolf Schroedter
<schroedter@users.sourceforge.net>. The function modified the
contents of the the 'value' string and now does not do this
anymore. This is a followup to the change made on 2001-12-17.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | win/tclWinSerial.c | 23 |
2 files changed, 17 insertions, 16 deletions
@@ -1,4 +1,12 @@ -2002-01-12 David Gravereaux <davygrvy@pobox.com> +2002-01-11 Andreas Kupries <andreas_kupries@users.sourceforge.net> + + * win/tclWinSerial.c (SerialSetOptionProc): Applied patch for SF + bug #500348 supplied by Rolf Schroedter + <schroedter@users.sourceforge.net>. The function modified the + contents of the the 'value' string and now does not do this + anymore. This is a followup to the change made on 2001-12-17. + +2002-01-11 David Gravereaux <davygrvy@pobox.com> * win/makefile.vc: Removed -GD compiler option. It was intended for future use, but MS is again changing the future at their whim. diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index d980df4..ae24bdc 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -11,7 +11,7 @@ * * Serial functionality implemented by Rolf.Schroedter@dlr.de * - * RCS: @(#) $Id: tclWinSerial.c,v 1.16 2001/12/19 19:34:18 hobbs Exp $ + * RCS: @(#) $Id: tclWinSerial.c,v 1.17 2002/01/11 20:21:32 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -1519,11 +1519,6 @@ SerialModemStatusStr(status, dsPtr) * *---------------------------------------------------------------------- */ -static void str_toupper( char *s ) -{ - while ( (*s = toupper(*s)) != '\0' ) s++ ; -} - static int SerialSetOptionProc(instanceData, interp, optionName, value) ClientData instanceData; /* File state. */ @@ -1618,15 +1613,14 @@ SerialSetOptionProc(instanceData, interp, optionName, value) dcb.XonLim = (WORD) (infoPtr->sysBufRead*1/2); dcb.XoffLim = (WORD) (infoPtr->sysBufRead*1/4); - str_toupper(value); - if (strncmp(value, "NONE", vlen) == 0) { + if (strnicmp(value, "NONE", vlen) == 0) { /* leave all handshake options disabled */ - } else if (strncmp(value, "XONXOFF", vlen) == 0) { + } else if (strnicmp(value, "XONXOFF", vlen) == 0) { dcb.fOutX = dcb.fInX = TRUE; - } else if (strncmp(value, "RTSCTS", vlen) == 0) { + } else if (strnicmp(value, "RTSCTS", vlen) == 0) { dcb.fOutxCtsFlow = TRUE; dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; - } else if (strncmp(value, "DTRDSR", vlen) == 0) { + } else if (strnicmp(value, "DTRDSR", vlen) == 0) { dcb.fOutxDsrFlow = TRUE; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; } else { @@ -1703,11 +1697,10 @@ SerialSetOptionProc(instanceData, interp, optionName, value) return TCL_ERROR; } while (argc > 1) { - str_toupper(argv[0]); if (Tcl_GetBoolean(interp, argv[1], &flag) == TCL_ERROR) { return TCL_ERROR; } - if (strncmp(argv[0], "DTR", strlen(argv[0])) == 0) { + if (strnicmp(argv[0], "DTR", strlen(argv[0])) == 0) { if (! EscapeCommFunction(infoPtr->handle, flag ? SETDTR : CLRDTR)) { if (interp) { Tcl_AppendResult(interp, @@ -1715,7 +1708,7 @@ SerialSetOptionProc(instanceData, interp, optionName, value) } return TCL_ERROR; } - } else if (strncmp(argv[0], "RTS", strlen(argv[0])) == 0) { + } else if (strnicmp(argv[0], "RTS", strlen(argv[0])) == 0) { if (! EscapeCommFunction(infoPtr->handle, flag ? SETRTS : CLRRTS)) { if (interp) { Tcl_AppendResult(interp, @@ -1723,7 +1716,7 @@ SerialSetOptionProc(instanceData, interp, optionName, value) } return TCL_ERROR; } - } else if (strncmp(argv[0], "BREAK", strlen(argv[0])) == 0) { + } else if (strnicmp(argv[0], "BREAK", strlen(argv[0])) == 0) { if (! EscapeCommFunction(infoPtr->handle, flag ? SETBREAK : CLRBREAK)) { if (interp) { Tcl_AppendResult(interp, |