diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MacroDefinitionRule.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MacroDefinitionRule.java index 0eb413832cf..b4fd6ea6a04 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MacroDefinitionRule.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MacroDefinitionRule.java @@ -157,9 +157,13 @@ class MacroDefinitionRule implements IPredicateRule { return true; } + protected boolean isValidCharacter(int c) { - char c0 = (char) c; - return Character.isLetterOrDigit(c0) || (c0 == '_'); + // From GNUMakefile manual: + // A variable name may be any sequence of characters not containing ‘:’, ‘#’, ‘=’, or leading or trailing whitespace. + // However, variable names containing characters other than letters, numbers, and underscores should be avoided, + // as they may be given special meanings in the future, and with some shells they cannot be passed through the environment to a sub-make + return !Character.isWhitespace(c) && c != ':' && c != '#' && c != '='; } }