diff options
author | vincentdarley <vincentdarley@noemail.net> | 2004-11-15 13:09:06 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley@noemail.net> | 2004-11-15 13:09:06 (GMT) |
commit | 57f32b07fb3585ece2114212a7614758a78a8466 (patch) | |
tree | dddeeb456d6e4da0dcc9a3bb66c685a26b076343 | |
parent | 9ca9e37ec5e50969e025777f401b2bc3fa9b7111 (diff) | |
download | tk-57f32b07fb3585ece2114212a7614758a78a8466.zip tk-57f32b07fb3585ece2114212a7614758a78a8466.tar.gz tk-57f32b07fb3585ece2114212a7614758a78a8466.tar.bz2 |
fix to one multi-line search bug
FossilOrigin-Name: b1df8d15e001b455bf415d6ca48742ea20cc3497
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tkText.c | 11 | ||||
-rw-r--r-- | tests/text.test | 4 |
3 files changed, 17 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2004-11-15 Vince Darley <vincentdarley@users.sourceforge.net> + + * generic/tkText.c: fix to multi-line search problem and + * tests/text.test: removed 'knownBug' from one test. + 2004-11-15 Donal K. Fellows <donal.k.fellows@man.ac.uk> * unix/tcl.m4, unix/configure.in: Expanded all AC_DEFINE calls to diff --git a/generic/tkText.c b/generic/tkText.c index eb7beb7..9f1f6ac 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.54 2004/09/23 14:57:03 vincentdarley Exp $ + * RCS: @(#) $Id: tkText.c,v 1.55 2004/11/15 13:09:07 vincentdarley Exp $ */ #include "default.h" @@ -5530,6 +5530,15 @@ SearchCore(interp, searchSpecPtr, patObj) || info.extendStart < 0) { break; } + /* + * If there is a match, but that match starts + * after the end of the first line, then we'll + * handle that next time around, when we're + * actually looking at that line. + */ + if (match && (info.matches[0].start >= lastOffset)) { + break; + } if (match && ((firstOffset + info.matches[0].end) >= prevFullLine)) { linesSearched = extraLines; diff --git a/tests/text.test b/tests/text.test index 70cbaa2..76f28a6 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.34 2004/11/09 12:46:10 vincentdarley Exp $ +# RCS: @(#) $Id: text.test,v 1.35 2004/11/15 13:09:08 vincentdarley Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -2648,7 +2648,7 @@ test text-20.172 {TextSearchCmd, regexp search multi-line} {knownBug} { # Should match at 1.0 for a true greedy match } {1.0} -test text-20.172.1 {TextSearchCmd, regexp search multi-line} {knownBug} { +test text-20.172.1 {TextSearchCmd, regexp search multi-line} { deleteWindows pack [text .t2] .t2 insert 1.0 "line0\nline1\nline1\nline1\nline1\nline2\nline2\nline2\nline3\n" |