Browse Source

Sanitize BF_DEPENDS_ defines

Brian Fiete 11 months ago
parent
commit
b9d0dc693f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      IDEHelper/Compiler/BfParser.cpp

+ 5 - 0
IDEHelper/Compiler/BfParser.cpp

@@ -935,6 +935,11 @@ MaybeBool BfParser::HandleIfDef(const StringImpl& name)
 			StringT<64> def = "BF_DEPENDS_";
 			def.Append(project->mName);
 			MakeUpper(def);
+			for (auto& c : def)
+			{
+				if (!isalnum((uint8)c))
+					c = '_';
+			}
 			mPreprocessorDefines[def] = BfDefineState_FromProject;
 		}
 		mAddedDependsDefines = true;