diff options
author | rjohnson <rjohnson@noemail.net> | 1999-04-20 01:04:03 (GMT) |
---|---|---|
committer | rjohnson <rjohnson@noemail.net> | 1999-04-20 01:04:03 (GMT) |
commit | 79259544e656387be65d0e5ed3c869b0a8ddf38d (patch) | |
tree | 416bff1e332ea545060a9dd1c9776b740aed5e73 /generic | |
parent | d1fd58487c0bfd40dc206fa03c2114976151e380 (diff) | |
download | tk-79259544e656387be65d0e5ed3c869b0a8ddf38d.zip tk-79259544e656387be65d0e5ed3c869b0a8ddf38d.tar.gz tk-79259544e656387be65d0e5ed3c869b0a8ddf38d.tar.bz2 |
Added new tests to scale and text.
Fixed core dump in text serach code: Bug 1642
FossilOrigin-Name: 9e52f3ffecf15cdcdacf2023f14b0beb21c47a9b
Diffstat (limited to 'generic')
-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; |