From fd60cf4ed6893ebbc878e093385154fab4c9b683 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 25 May 2021 10:21:25 -0400 Subject: [PATCH] Fix #1048, also filter C++-style comments Truncate input lines at C++-style comment markers, in case users/projects allow this style of comment. --- ut_assert/scripts/generate_stubs.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ut_assert/scripts/generate_stubs.pl b/ut_assert/scripts/generate_stubs.pl index 720ee37f1..9dff1e610 100755 --- a/ut_assert/scripts/generate_stubs.pl +++ b/ut_assert/scripts/generate_stubs.pl @@ -129,6 +129,12 @@ } close(HDR); + foreach (@lines) + { + # Truncate each line at C++-style comment + s/\/\/.*$//; + } + # combine all content into a single string # this eases processing of multi-line constructs $file = join('', @lines);