1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

fixed some minor bugs

This commit is contained in:
Mikhail Sennikovsky 2005-05-26 15:13:52 +00:00
parent 795d676119
commit 60679c4044
5 changed files with 9 additions and 10 deletions

View file

@ -314,12 +314,11 @@ public class UserDefinedEnvironmentSupplier extends
}
protected String getValidName(String name){
name = EnvVarOperationProcessor.normalizeName(name);
if(name == null)
if(name == null || (name = name.trim()).length() == 0)
return null;
if(fNonOverloadableVariables != null){
for(int i = 0; i < fNonOverloadableVariables.length; i++){
if(name.equals(fNonOverloadableVariables[i]))
if(fNonOverloadableVariables[i].equals(EnvVarOperationProcessor.normalizeName(name)))
return null;
}
}

View file

@ -196,7 +196,7 @@ public class BuildMacroProvider implements IBuildMacroProvider {
IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
if(info != null)
MacroResolver.resolveToStringList(value,getMacroSubstitutor(info,nonexistentMacrosValue, " ")); //$NON-NLS-1$
return MacroResolver.resolveToStringList(value,getMacroSubstitutor(info,nonexistentMacrosValue, " ")); //$NON-NLS-1$
return null;
}

View file

@ -168,7 +168,8 @@ public class BuildfileMacroSubstitutor extends DefaultMacroSubstitutor {
protected ResolvedMacro resolveMacro(IBuildMacro macro) throws BuildMacroException{
ResolvedMacro resolved = null;
if(!UserDefinedMacroSupplier.getInstance().areMacrosExpanded(fConfiguration) &&
if(fConfiguration != null && fBuilder != null &&
!UserDefinedMacroSupplier.getInstance().areMacrosExpanded(fConfiguration) &&
macro instanceof EnvironmentMacroSupplier.EnvVarMacro){
String ref = getMacroReference(macro);
if(ref != null)

View file

@ -165,12 +165,11 @@ public class ExternalExtensionMacroSupplier implements IBuildMacroSupplier {
}
protected String getValidName(String name){
name = EnvVarOperationProcessor.normalizeName(name);
if(name == null)
if(name == null || (name = name.trim()).length() == 0)
return null;
if(fNonOverloadableMacros != null){
for(int i = 0; i < fNonOverloadableMacros.length; i++){
if(name.equals(fNonOverloadableMacros[i].toUpperCase()))
if(fNonOverloadableMacros[i].equals(EnvVarOperationProcessor.normalizeName(name)))
return null;
}
}

View file

@ -1128,12 +1128,12 @@ public class MacrosBlock extends AbstractCOptionPage {
* answers whether the macro of a given name can be sreated
*/
public boolean canCreate(String name){
if((name = EnvVarOperationProcessor.normalizeName(name)) == null)
if(name == null || (name = name.trim()).length() == 0)
return false;
if(fHiddenMacros != null){
for(int i = 0; i < fHiddenMacros.length; i++){
if(name.equals(fHiddenMacros[i].toUpperCase()))
if(fHiddenMacros[i].equals(EnvVarOperationProcessor.normalizeName(name)))
return false;
}
}