1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for 101903: Junit failures for RC1

This commit is contained in:
Bogdan Gheorghe 2005-06-27 19:13:00 +00:00
parent d30c9cee80
commit c79f8eb661
2 changed files with 14 additions and 2 deletions

View file

@ -337,7 +337,8 @@ public class DOMSearchUtil {
private static IASTName[] getNames(IASTTranslationUnit tu, IBinding binding, LimitTo limitTo) {
IASTName[] names = null;
if (limitTo == ICSearchConstants.DECLARATIONS) {
if (limitTo == ICSearchConstants.DECLARATIONS ||
limitTo == ICSearchConstants.DECLARATIONS_DEFINITIONS) {
names = tu.getDeclarations(binding);
} else if (limitTo == ICSearchConstants.REFERENCES) {
names = tu.getReferences(binding);

View file

@ -513,8 +513,19 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons
String text;
try {
text= reader.readLine();
if (text == null)
if (text == null){
text= ""; //$NON-NLS-1$
} else {
//The user has selected something - we don't want to "redo" too much of the selection
//but we need to ensure that it has the maximum chance of matching something in the index.
//So we need to: i) get rid of any semi-colons if there are any
int indexSemi = text.indexOf(';');
//Check to see if there are any semi-colons in the selected string, if there are select up to the semi colon
if (indexSemi != -1){
text = text.substring(0, indexSemi);
}
}
} catch (IOException ex) {
text= ""; //$NON-NLS-1$
}