diff options
author | rjohnson <rjohnson> | 1999-04-20 01:04:04 (GMT) |
---|---|---|
committer | rjohnson <rjohnson> | 1999-04-20 01:04:04 (GMT) |
commit | 96b0a8952cacebf737d5a9c9cc350a0e1f031be1 (patch) | |
tree | 416bff1e332ea545060a9dd1c9776b740aed5e73 /generic/tkText.c | |
parent | c999728b7c7b84d88a81c5e223f2a5821eafe4f7 (diff) | |
download | tk-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/tkText.c')
-rw-r--r-- | generic/tkText.c | 7 |
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; |