Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2007-07-09 15:54:47 +0000
committerMichael Rennie2007-07-09 15:54:47 +0000
commitafa5dbfaf16295fe73cc7ca6ab538d9c2d698ddc (patch)
tree475cd3dc1163dfd3b5f356fbd90d466bfe341e6c /org.eclipse.ui.console
parent5af5985e9dd81c5d609faf5abd2186635051fcd0 (diff)
downloadeclipse.platform.debug-afa5dbfaf16295fe73cc7ca6ab538d9c2d698ddc.tar.gz
eclipse.platform.debug-afa5dbfaf16295fe73cc7ca6ab538d9c2d698ddc.tar.xz
eclipse.platform.debug-afa5dbfaf16295fe73cc7ca6ab538d9c2d698ddc.zip
Bug 194509
infinite loop in console
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java
index aa8e1570c..e58e518f1 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@ import org.eclipse.core.runtime.Assert;
/**
* Adapts a Console's document to the viewer StyledText widget. Allows proper line
- * wrapping of fixed width consoles without having to add line delimeters to the StyledText.
+ * wrapping of fixed width consoles without having to add line delimiters to the StyledText.
*
* By using this adapter, the offset of any character is the same in both the widget and the
* document.
@@ -200,7 +200,10 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
int midIndex = 0;
while (left <= right) {
- midIndex= (left + right) / 2;
+ if(left == right) {
+ return right;
+ }
+ midIndex = (left + right) / 2;
if (offset < offsets[midIndex]) {
right = midIndex;

Back to the top