diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-25 07:24:04 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-25 07:24:04 (GMT) |
commit | f182c12f4a885f158795c23c07ffbc23af91c41e (patch) | |
tree | 088cb08cc1c8f06f646577e8399ee87124c6ec7b /win/tclWinDde.c | |
parent | b8df44e69e283fac9c93c0f64a77f61780e11ada (diff) | |
download | tcl-f182c12f4a885f158795c23c07ffbc23af91c41e.zip tcl-f182c12f4a885f158795c23c07ffbc23af91c41e.tar.gz tcl-f182c12f4a885f158795c23c07ffbc23af91c41e.tar.bz2 |
[Bug 473946]: special characters not correctly sent, now for XTYP_EXECUTE as well as XTYP_REQUEST.
Fix "make genstubs" when cross-compiling on UNIX
Diffstat (limited to 'win/tclWinDde.c')
-rw-r--r-- | win/tclWinDde.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/win/tclWinDde.c b/win/tclWinDde.c index 4ef7f41..4aa6f71 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -593,9 +593,9 @@ DdeServerProc( utilString = (char *) DdeAccessData(hData, &dlen); uniStr = (Tcl_UniChar *) utilString; if (!dlen) { - /* Empty string. (Since TIP #106 we can create this!) */ + /* Empty binary array. */ ddeObjectPtr = Tcl_NewObj(); - } else if (0) { + } else if ((dlen & 1) || uniStr[(dlen>>1)-1]) { /* Cannot be unicode, so assume utf-8 */ if (!utilString[dlen-1]) { dlen--; @@ -604,7 +604,7 @@ DdeServerProc( } else { /* unicode */ dlen >>= 1; - ddeObjectPtr = Tcl_NewUnicodeObj(uniStr, dlen); + ddeObjectPtr = Tcl_NewUnicodeObj(uniStr, dlen - 1); } Tcl_IncrRefCount(ddeObjectPtr); DdeUnaccessData(hData); |