summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2013-03-02 07:22:21 (GMT)
committerjenglish <jenglish@flightlab.com>2013-03-02 07:22:21 (GMT)
commitcb6f189d6d5129efb67a28562013de4f96f18bd8 (patch)
tree2b75e863c806b5c4596b3dc9a0c4c0759b42c176
parent81ce84960bfe9e4e877418798394c6daafc7ff78 (diff)
downloadtcl-cb6f189d6d5129efb67a28562013de4f96f18bd8.zip
tcl-cb6f189d6d5129efb67a28562013de4f96f18bd8.tar.gz
tcl-cb6f189d6d5129efb67a28562013de4f96f18bd8.tar.bz2
Do not use strncasecmp(). It is nonstandard and not portable.
Use Tcl_UtfNcasecmp() instead.
-rw-r--r--unix/tclUnixChan.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index fb47f6a..178c0bc 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -630,20 +630,20 @@ TtySetOptionProc(
#ifdef CRTSCTS
CLEAR_BITS(iostate.c_cflag, CRTSCTS);
#endif /* CRTSCTS */
- if (strncasecmp(value, "NONE", vlen) == 0) {
+ if (Tcl_UtfNcasecmp(value, "NONE", vlen) == 0) {
/*
* Leave all handshake options disabled.
*/
- } else if (strncasecmp(value, "XONXOFF", vlen) == 0) {
+ } else if (Tcl_UtfNcasecmp(value, "XONXOFF", vlen) == 0) {
SET_BITS(iostate.c_iflag, IXON | IXOFF | IXANY);
- } else if (strncasecmp(value, "RTSCTS", vlen) == 0) {
+ } else if (Tcl_UtfNcasecmp(value, "RTSCTS", vlen) == 0) {
#ifdef CRTSCTS
SET_BITS(iostate.c_cflag, CRTSCTS);
#else /* !CRTSTS */
UNSUPPORTED_OPTION("-handshake RTSCTS");
return TCL_ERROR;
#endif /* CRTSCTS */
- } else if (strncasecmp(value, "DTRDSR", vlen) == 0) {
+ } else if (Tcl_UtfNcasecmp(value, "DTRDSR", vlen) == 0) {
UNSUPPORTED_OPTION("-handshake DTRDSR");
return TCL_ERROR;
} else {
@@ -741,19 +741,19 @@ TtySetOptionProc(
ckfree(argv);
return TCL_ERROR;
}
- if (strncasecmp(argv[i], "DTR", strlen(argv[i])) == 0) {
+ if (Tcl_UtfNcasecmp(argv[i], "DTR", strlen(argv[i])) == 0) {
if (flag) {
SET_BITS(control, TIOCM_DTR);
} else {
CLEAR_BITS(control, TIOCM_DTR);
}
- } else if (strncasecmp(argv[i], "RTS", strlen(argv[i])) == 0) {
+ } else if (Tcl_UtfNcasecmp(argv[i], "RTS", strlen(argv[i])) == 0) {
if (flag) {
SET_BITS(control, TIOCM_RTS);
} else {
CLEAR_BITS(control, TIOCM_RTS);
}
- } else if (strncasecmp(argv[i], "BREAK", strlen(argv[i])) == 0) {
+ } else if (Tcl_UtfNcasecmp(argv[i], "BREAK", strlen(argv[i])) == 0) {
#if defined(TIOCSBRK) && defined(TIOCCBRK)
if (flag) {
ioctl(fsPtr->fd, TIOCSBRK, NULL);