diff --git a/lib/cmock_generator.rb b/lib/cmock_generator.rb index 1e710555..dfbe3e26 100644 --- a/lib/cmock_generator.rb +++ b/lib/cmock_generator.rb @@ -208,7 +208,7 @@ def create_mock_header_footer(header) end def create_source_header_section(file, filename, mock_project) - header_file = (mock_project[:folder] || '') + filename.gsub('.c', mock_project[:module_ext]) + header_file = (mock_project[:folder] || '') + filename.sub(/.*\K\.c/, mock_project[:module_ext]) file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n" unless mock_project[:parsed_stuff][:functions].empty? file << "#include \n" file << "#include \n"