summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorrjohnson <rjohnson>1999-04-20 01:04:04 (GMT)
committerrjohnson <rjohnson>1999-04-20 01:04:04 (GMT)
commit96b0a8952cacebf737d5a9c9cc350a0e1f031be1 (patch)
tree416bff1e332ea545060a9dd1c9776b740aed5e73 /generic
parentc999728b7c7b84d88a81c5e223f2a5821eafe4f7 (diff)
downloadtk-96b0a8952cacebf737d5a9c9cc350a0e1f031be1.zip
tk-96b0a8952cacebf737d5a9c9cc350a0e1f031be1.tar.gz
tk-96b0a8952cacebf737d5a9c9cc350a0e1f031be1.tar.bz2
Added new tests to scale and text.
Fixed core dump in text serach code: Bug 1642
Diffstat (limited to 'generic')
-rw-r--r--generic/tkText.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index ff08140..b607917 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkText.c,v 1.5 1999/04/17 02:35:38 rjohnson Exp $
+ * RCS: @(#) $Id: tkText.c,v 1.6 1999/04/20 01:04:04 rjohnson Exp $
*/
#include "default.h"
@@ -1716,12 +1716,13 @@ TextSearchCmd(textPtr, interp, argc, argv)
/*
* Check for matches within the current line. If so, and if we're
* searching backwards, repeat the search to find the last match
- * in the line.
+ * in the line. (Note: The lastByte should include the NULL char
+ * so we can handle searching for end of line easier.)
*/
matchByte = -1;
firstByte = 0;
- lastByte = INT_MAX;
+ lastByte = Tcl_DStringLength(&line) + 1;
if (lineNum == startingLine) {
int indexInDString;