Commit e1129142 authored by Boris Bügling's avatar Boris Bügling

Improved sanitizing of configuration names.

Fixes #2542
parent fd8d01fc
......@@ -209,7 +209,7 @@ module Pod
#
def add_build_configuration(name, type)
build_configuration = super
values = ["#{name.gsub(' ', '_').upcase}=1"]
values = ["#{name.gsub(/[^a-zA-Z0-9_]/, '_').upcase}=1"]
settings = build_configuration.build_settings
definitions = Array(settings['GCC_PREPROCESSOR_DEFINITIONS'])
values.each do |value|
......
......@@ -233,6 +233,12 @@ module Pod
settings['GCC_PREPROCESSOR_DEFINITIONS'].should.include('RELEASE=1')
end
it "doesn't create invalid preprocessor definitions for configurations" do
configuration = @project.add_build_configuration('Release-Foo.bar', :release)
settings = configuration.build_settings
settings['GCC_PREPROCESSOR_DEFINITIONS'].should.include('RELEASE_FOO_BAR=1')
end
it "doesn't duplicate values" do
original = @project.build_configuration_list['Debug']
original_settings = original.build_settings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment