From b4c4b327e2f8e7445c0ee9b743faaaa1067941d0 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 17 Jan 2010 06:50:33 +0000 Subject: [PATCH] Fixed bug 299860. --- .../eclipse/cdt/internal/ui/search/LineSearchElement.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java index eb12ac77011..48343800270 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LineSearchElement.java @@ -8,6 +8,7 @@ * Contributors: * Andrey Eremchenko, kamre@ngs.ru - 222495 C/C++ search should show line matches and line numbers * Markus Schorn (Wind River Systems) + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.ui.search; @@ -231,7 +232,7 @@ public class LineSearchElement extends PDOMSearchElement { continue; } // compare offset of next match with current position - if (nextMatchOffset > pos) + if (nextMatchOffset > pos || nextMatch >= matches.length) continue; // next match was reached // check if this match is the first for current line @@ -242,9 +243,6 @@ public class LineSearchElement extends PDOMSearchElement { if (nextMatch < matches.length) { // update offset of next match nextMatchOffset = matches[nextMatch].getOffset(); - } else { - // no more matches - break; } } // check if there were matches on the last line