mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 02:36:01 +02:00
fixed some minor bugs
This commit is contained in:
parent
795d676119
commit
60679c4044
5 changed files with 9 additions and 10 deletions
|
@ -314,12 +314,11 @@ public class UserDefinedEnvironmentSupplier extends
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getValidName(String name){
|
protected String getValidName(String name){
|
||||||
name = EnvVarOperationProcessor.normalizeName(name);
|
if(name == null || (name = name.trim()).length() == 0)
|
||||||
if(name == null)
|
|
||||||
return null;
|
return null;
|
||||||
if(fNonOverloadableVariables != null){
|
if(fNonOverloadableVariables != null){
|
||||||
for(int i = 0; i < fNonOverloadableVariables.length; i++){
|
for(int i = 0; i < fNonOverloadableVariables.length; i++){
|
||||||
if(name.equals(fNonOverloadableVariables[i]))
|
if(fNonOverloadableVariables[i].equals(EnvVarOperationProcessor.normalizeName(name)))
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,7 @@ public class BuildMacroProvider implements IBuildMacroProvider {
|
||||||
|
|
||||||
IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
|
IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
|
||||||
if(info != null)
|
if(info != null)
|
||||||
MacroResolver.resolveToStringList(value,getMacroSubstitutor(info,nonexistentMacrosValue, " ")); //$NON-NLS-1$
|
return MacroResolver.resolveToStringList(value,getMacroSubstitutor(info,nonexistentMacrosValue, " ")); //$NON-NLS-1$
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,8 @@ public class BuildfileMacroSubstitutor extends DefaultMacroSubstitutor {
|
||||||
protected ResolvedMacro resolveMacro(IBuildMacro macro) throws BuildMacroException{
|
protected ResolvedMacro resolveMacro(IBuildMacro macro) throws BuildMacroException{
|
||||||
ResolvedMacro resolved = null;
|
ResolvedMacro resolved = null;
|
||||||
|
|
||||||
if(!UserDefinedMacroSupplier.getInstance().areMacrosExpanded(fConfiguration) &&
|
if(fConfiguration != null && fBuilder != null &&
|
||||||
|
!UserDefinedMacroSupplier.getInstance().areMacrosExpanded(fConfiguration) &&
|
||||||
macro instanceof EnvironmentMacroSupplier.EnvVarMacro){
|
macro instanceof EnvironmentMacroSupplier.EnvVarMacro){
|
||||||
String ref = getMacroReference(macro);
|
String ref = getMacroReference(macro);
|
||||||
if(ref != null)
|
if(ref != null)
|
||||||
|
|
|
@ -165,12 +165,11 @@ public class ExternalExtensionMacroSupplier implements IBuildMacroSupplier {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getValidName(String name){
|
protected String getValidName(String name){
|
||||||
name = EnvVarOperationProcessor.normalizeName(name);
|
if(name == null || (name = name.trim()).length() == 0)
|
||||||
if(name == null)
|
|
||||||
return null;
|
return null;
|
||||||
if(fNonOverloadableMacros != null){
|
if(fNonOverloadableMacros != null){
|
||||||
for(int i = 0; i < fNonOverloadableMacros.length; i++){
|
for(int i = 0; i < fNonOverloadableMacros.length; i++){
|
||||||
if(name.equals(fNonOverloadableMacros[i].toUpperCase()))
|
if(fNonOverloadableMacros[i].equals(EnvVarOperationProcessor.normalizeName(name)))
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1128,12 +1128,12 @@ public class MacrosBlock extends AbstractCOptionPage {
|
||||||
* answers whether the macro of a given name can be sreated
|
* answers whether the macro of a given name can be sreated
|
||||||
*/
|
*/
|
||||||
public boolean canCreate(String name){
|
public boolean canCreate(String name){
|
||||||
if((name = EnvVarOperationProcessor.normalizeName(name)) == null)
|
if(name == null || (name = name.trim()).length() == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(fHiddenMacros != null){
|
if(fHiddenMacros != null){
|
||||||
for(int i = 0; i < fHiddenMacros.length; i++){
|
for(int i = 0; i < fHiddenMacros.length; i++){
|
||||||
if(name.equals(fHiddenMacros[i].toUpperCase()))
|
if(fHiddenMacros[i].equals(EnvVarOperationProcessor.normalizeName(name)))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue