From 6afd6f91b8c15a29653e73917e753147c23d0473 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 23 Nov 2023 16:38:01 +0200 Subject: [preproc] Fixed no substitution when there are stuff after a macro name on the start of a line --- preproc.awk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/preproc.awk b/preproc.awk index b574edf..c9bcb07 100644 --- a/preproc.awk +++ b/preproc.awk @@ -163,18 +163,20 @@ stage2 && macroNameOnly { } stage2 && /^[[:blank:]]*<[^>]*>/ { - match($0, /<[^>]*>/) # If we found a definition if ($0 ~ "{") { macroName = "" depth = gsub("{", "{") - gsub("}", "}") + next } - # Macro name could begin a potential definition, with a "{" on a new line - else { + # If there isn't anything nonblank after the macro name then it might + # be the name of a potential definition, with a "{" on another line + else if (match($0, /<[^>]*>[[:blank:]]*[^[:blank:]]/) == 0) { + match($0, /<[^>]*>/) macroName = substr($0, RSTART, RLENGTH) macroNameOnly = 1 + next } - next } # Outside definition -- cgit v1.2.3