summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-10-17 23:38:01 (GMT)
committerhobbs <hobbs>2002-10-17 23:38:01 (GMT)
commit49e5f064fe4ae37926721fb362f22d4f21849cf5 (patch)
treec80e54b66b58bb37c2cc0d3131187ee22108d012
parent4daf29d9a0b9a8529bb1ce12c07efbe3ec1e0da7 (diff)
downloadtk-49e5f064fe4ae37926721fb362f22d4f21849cf5.zip
tk-49e5f064fe4ae37926721fb362f22d4f21849cf5.tar.gz
tk-49e5f064fe4ae37926721fb362f22d4f21849cf5.tar.bz2
* tests/text.test: properly return the number of
* unix/tkUnixFont.c (ControlUtfProc): bytes consumed. [Bug #624732]
-rw-r--r--ChangeLog5
-rw-r--r--tests/text.test21
-rw-r--r--unix/tkUnixFont.c9
3 files changed, 17 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a1be6b..fb1ae12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/text.test: properly return the number of
+ * unix/tkUnixFont.c (ControlUtfProc): bytes consumed. [Bug #624732]
+
2002-10-17 Daniel Steffen <das@users.sourceforge.net>
* macosx/README: info specific to building and running
diff --git a/tests/text.test b/tests/text.test
index 0ea9165..1c21d21 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: text.test,v 1.18 2002/07/13 20:28:35 dgp Exp $
+# RCS: @(#) $Id: text.test,v 1.19 2002/10/17 23:38:01 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -1573,22 +1573,15 @@ test text-25.13 {-maxundo configuration option} {
.t get 1.0 end
} "line 1\n\n"
+test text-26.1 {bug fix - 624372, ControlUtfProc long lines} {
+ destroy .t
+ pack [text .t -wrap none]
+ .t insert end [string repeat "\1" 500]
+} {}
+
deleteWindows
option clear
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 5f5b881..de4c8e2 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixFont.c,v 1.15 2002/08/05 04:30:41 dgp Exp $
+ * RCS: @(#) $Id: tkUnixFont.c,v 1.16 2002/10/17 23:38:01 hobbs Exp $
*/
#include "tkUnixInt.h"
@@ -406,7 +406,7 @@ ControlUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen,
* correspond to the bytes stored in the
* output buffer. */
{
- CONST char *srcEnd;
+ CONST char *srcStart, *srcEnd;
char *dstStart, *dstEnd;
Tcl_UniChar ch;
int result;
@@ -416,8 +416,9 @@ ControlUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen,
'a', 'b', 't', 'n', 'v', 'f', 'r'
};
- result = TCL_OK;
+ result = TCL_OK;
+ srcStart = src;
srcEnd = src + srcLen;
dstStart = dst;
@@ -447,7 +448,7 @@ ControlUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen,
dst += 6;
}
}
- *srcReadPtr = src - srcEnd;
+ *srcReadPtr = src - srcStart;
*dstWrotePtr = dst - dstStart;
*dstCharsPtr = dst - dstStart;
return result;