summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2007-11-05 19:37:06 (GMT)
committerandreas_kupries <akupries@shaw.ca>2007-11-05 19:37:06 (GMT)
commit791ccfdcdbc2bee84c4100c5a2c66e600ff247c2 (patch)
treea583a45bbf5dd65eee5023809fa22a5903bc9737
parent71b6a5824485a25d8b7be9c26103252cb50ed5f6 (diff)
downloadtcl-791ccfdcdbc2bee84c4100c5a2c66e600ff247c2.zip
tcl-791ccfdcdbc2bee84c4100c5a2c66e600ff247c2.tar.gz
tcl-791ccfdcdbc2bee84c4100c5a2c66e600ff247c2.tar.bz2
* unix/tclUnixChan.c (TtyGetOptionProc): Accepted [SF Tcl Patch
1823576] provided by Stuart Cassof <stwo@users.sourceforge.net>. The patch adds the necessary utf/external conversions to the handling of the arguments of option -xchar which will allow the use of \0 and similar characters.
-rw-r--r--ChangeLog8
-rw-r--r--tools/Makefile.in4
-rw-r--r--unix/tclUnixChan.c30
3 files changed, 32 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index a597481..0cfe581 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-05 Andreas Kupries <andreask@activestate.com>
+
+ * unix/tclUnixChan.c (TtyGetOptionProc): Accepted [SF Tcl Patch
+ 1823576] provided by Stuart Cassof <stwo@users.sourceforge.net>.
+ The patch adds the necessary utf/external conversions to the
+ handling of the arguments of option -xchar which will allow the
+ use of \0 and similar characters.
+
2007-11-03 Miguel Sofer <msofer@users.sf.net>
* generic/tclTest.c (TestSetCmd2):
diff --git a/tools/Makefile.in b/tools/Makefile.in
index ecd115a..cf23296 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -6,7 +6,7 @@
#
# HTML: 1. Build the html target on Unix
-# RCS: @(#) $Id: Makefile.in,v 1.9 2000/04/20 01:30:20 hobbs Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.10 2007/11/05 19:37:07 andreas_kupries Exp $
TCL = tcl@TCL_VERSION@
TK = tk@TCL_VERSION@
@@ -66,4 +66,4 @@ clean:
-rm -f man2tcl *.o *.cnt *.rtf
helpfile:
- hcw /c /e tcl.hpj
+ hcw /c /e tcl.hpj \ No newline at end of file
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 15629a2..aeb8539 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.82 2007/09/17 11:38:14 das Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.83 2007/11/05 19:37:07 andreas_kupries Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -967,8 +967,16 @@ TtySetOptionProc(
return TCL_ERROR;
}
if (argc == 2) {
- iostate.c_cc[VSTART] = argv[0][0];
- iostate.c_cc[VSTOP] = argv[1][0];
+ Tcl_DString ds;
+ Tcl_DStringInit(&ds);
+
+ Tcl_UtfToExternalDString(NULL, argv[0], -1, &ds);
+ iostate.c_cc[VSTART] = *(const cc_t *) Tcl_DStringValue(&ds);
+ Tcl_DStringSetLength(&ds, 0);
+
+ Tcl_UtfToExternalDString(NULL, argv[1], -1, &ds);
+ iostate.c_cc[VSTOP] = *(const cc_t *) Tcl_DStringValue(&ds);
+ Tcl_DStringFree(&ds);
} else {
if (interp) {
Tcl_AppendResult(interp, "bad value for -xchar: "
@@ -1142,13 +1150,19 @@ TtyGetOptionProc(
}
if (len==0 || (len>1 && strncmp(optionName, "-xchar", len)==0)) {
IOSTATE iostate;
-
+ Tcl_DString ds;
valid = 1;
+
GETIOSTATE(fsPtr->fd, &iostate);
- sprintf(buf, "%c", iostate.c_cc[VSTART]);
- Tcl_DStringAppendElement(dsPtr, buf);
- sprintf(buf, "%c", iostate.c_cc[VSTOP]);
- Tcl_DStringAppendElement(dsPtr, buf);
+ Tcl_DStringInit(&ds);
+
+ Tcl_ExternalToUtfDString(NULL, (const char *) &iostate.c_cc[VSTART], 1, &ds);
+ Tcl_DStringAppendElement(dsPtr, (const char *) Tcl_DStringValue(&ds));
+ Tcl_DStringSetLength(&ds, 0);
+
+ Tcl_ExternalToUtfDString(NULL, (const char *) &iostate.c_cc[VSTOP], 1, &ds);
+ Tcl_DStringAppendElement(dsPtr, (const char *) Tcl_DStringValue(&ds));
+ Tcl_DStringFree(&ds);
}
if (len == 0) {
Tcl_DStringEndSublist(dsPtr);