From 65ce7929a570ef9769d930d039a106a485740d4b Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Tue, 7 Jan 2025 18:06:21 -0500 Subject: [PATCH] Fix error in preprocessing includes: multiple includes with paths were accidentally being deleted --- lib/ceedling/preprocessinator_file_handler.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ceedling/preprocessinator_file_handler.rb b/lib/ceedling/preprocessinator_file_handler.rb index cdb75a87..94892cb1 100644 --- a/lib/ceedling/preprocessinator_file_handler.rb +++ b/lib/ceedling/preprocessinator_file_handler.rb @@ -133,8 +133,8 @@ def assemble_preprocessed_header_file(filename:, preprocessed_filepath:, content # ---------------------------------------------------- # - We rely on search paths at compilation rather than explicit #include paths # - Match (#include ")((path/)+)(file") and reassemble string using first and last matching groups - _contents.gsub!( /(#include\s+")(([^\/]+\/)+)(.+")/, '\1\4' ) - + _contents.gsub!( /(#include\s+")(?:(?:[^"\/]+\/)+)([^"\/]*")/, '\1\2' ) + # Write contents of final preprocessed file @file_wrapper.write( preprocessed_filepath, _contents ) end