From cf0e55b6e412f8dfd7ab90a7022ff6d794cbcae2 Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Thu, 9 Jan 2020 22:00:41 +0100 Subject: [PATCH] Fix system test compile error if there is no semicolon in the file, first_semicolon is nil, so check it before using it. --- lib/cmock_header_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index 7fdce67..1c9a298 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -174,7 +174,7 @@ class CMockHeaderParser first_open_bracket = inline_function_match.post_match.index("{") first_semicolon = inline_function_match.post_match.index(";") - if first_open_bracket.nil? or first_semicolon < first_open_bracket + if first_open_bracket.nil? or (!first_semicolon.nil? and first_semicolon < first_open_bracket) puts "DECLARATION, IGNORE" source = inline_function_match.pre_match + inline_function_match.post_match next