kernel-doc: fix processing nested structs with attributes
authorAndré Almeida <andrealmeid@collabora.com>
Tue, 17 Nov 2020 16:52:44 +0000 (17:52 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Dec 2020 17:15:20 +0000 (12:15 -0500)
commit872e6c47a083be5afb82b40aae849c7108ae5584
treed93672d6d98e9dc55bb6fc36c624bd24bd998d49
parentf79248b53bee83bb8e69c8b2e9d70d6d28039987
kernel-doc: fix processing nested structs with attributes

The current regular expression for strip attributes of structs (and
for nested ones as well) also removes all whitespaces that may
surround the attribute. After that, the code will split structs and
iterate for each symbol separated by comma at the end of struct
definition (e.g. "} alias1, alias2;"). However, if the nested struct
does not have any alias and has an attribute, it will result in a
empty string at the closing bracket (e.g "};"). This will make the
split return nothing and $newmember will keep uninitialized. Fix
that, by ensuring that the attribute substitution will leave at least
one whitespace.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201117165312.118257-2-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/kernel-doc