[ros-diffs] [cwittich] 24805: -always keep the correct file extension (fixes building of control panel applets) -escape defines (fixes loading of some project files)

cwittich at svn.reactos.org cwittich at svn.reactos.org
Thu Nov 23 12:38:50 CET 2006


Author: cwittich
Date: Thu Nov 23 14:38:49 2006
New Revision: 24805

URL: http://svn.reactos.org/svn/reactos?rev=24805&view=rev
Log:
-always keep the correct file extension (fixes building of control panel applets)
-escape defines (fixes loading of some project files)

Modified:
    trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp

Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp?rev=24805&r1=24804&r2=24805&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Thu Nov 23 14:38:49 2006
@@ -402,9 +402,14 @@
 		for ( i = 0; i < defs.size(); i++ )
 		{
 			if ( defs[i]->value[0] )
-				common_defines.push_back( defs[i]->name + "=" + defs[i]->value );
+			{
+				const string& escaped = _replace_str(defs[i]->value, "\"","&quot;");
+				common_defines.push_back( defs[i]->name + "=" + escaped );
+			}
 			else
+			{
 				common_defines.push_back( defs[i]->name );
+			}
 		}
 		/*const vector<Property*>& variables = data.properties;
 		for ( i = 0; i < variables.size(); i++ )
@@ -439,12 +444,12 @@
 
 		if ( configuration.UseConfigurationInPath )
 		{
-			fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(), module_type.c_str());
+			fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s%s\\%s%s\" prefix_auto=\"0\" extension_auto=\"0\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), cfg.name.c_str(), module.name.c_str(), module_type.c_str());
 			fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str (), cfg.name.c_str() );
 		}
 		else
 		{
-			fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\" prefix_auto=\"1\" extension_auto=\"1\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() );
+			fprintf ( OUT, "\t\t\t\t<Option output=\"%s\\%s\\%s%s\" prefix_auto=\"0\" extension_auto=\"0\" />\r\n", outdir.c_str (), module.GetBasePath ().c_str (), module.name.c_str(), module_type.c_str() );
 			fprintf ( OUT, "\t\t\t\t<Option object_output=\"%s\\%s\" />\r\n", intdir.c_str(), module.GetBasePath ().c_str () );
 		}
 
@@ -610,3 +615,19 @@
 			this->name = "Unknown";
 	}
 }
+
+std::string
+CBBackend::_replace_str(std::string string1, const std::string &find_str, const std::string &replace_str)
+{
+	std::string::size_type pos = string1.find(find_str, 0);
+	int intLen = find_str.length();
+
+	while(std::string::npos != pos)
+	{
+		string1.replace(pos, intLen, replace_str);
+		pos = string1.find(find_str, intLen + pos);
+	}
+
+	return string1;
+}
+




More information about the Ros-diffs mailing list