1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Bug 442123: java.lang.StringIndexOutOfBoundsException in

org.eclipse.cdt.make.internal.ui.text.WordPartDetector
This commit is contained in:
Andrew Gvozdev 2014-09-09 15:22:41 -04:00
parent 58af86640b
commit 63c28d216f

View file

@ -119,7 +119,11 @@ public class WordPartDetector {
// the cursor is on the first word which is "include" keyword
// so find the second word which is the first include file
String sub = line.substring(line.indexOf(' ', position)).trim();
wordPart = sub.substring(0, sub.indexOf(' ')).trim();
if (sub.contains(" ")) { //$NON-NLS-1$
wordPart = sub.substring(0, sub.indexOf(' ')).trim();
} else {
wordPart = sub;
}
} else {
wordPart = findWord(line, position);
}