Skip to content

Commit 6a8e03b

Browse files
committed
Fix filename sanitization with command line option
When enabling the command line option the file name added to the runner did not escape the slashes on windows in the same way other paths where sanitized. Copied the sanitization from the other filename uses.
1 parent c40b80a commit 6a8e03b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

auto/generate_test_runner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def create_main(output, filename, tests, used_mocks)
389389
output.puts(' {')
390390
output.puts(' if (parse_status < 0)')
391391
output.puts(' {')
392-
output.puts(" UnityPrint(\"#{filename.gsub('.c', '')}.\");")
392+
output.puts(" UnityPrint(\"#{filename.gsub('.c', '').gsub(/\\/, '\\\\\\')}.\");")
393393
output.puts(' UNITY_PRINT_EOL();')
394394
tests.each do |test|
395395
if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty?

0 commit comments

Comments
 (0)