]> git.baikalelectronics.ru Git - kernel.git/commit
kernel-doc: fix processing nested structs with attributes
authorAndré Almeida <andrealmeid@collabora.com>
Tue, 17 Sep 2019 19:41:45 +0000 (16:41 -0300)
committerJonathan Corbet <corbet@lwn.net>
Tue, 1 Oct 2019 12:57:12 +0000 (06:57 -0600)
commit905ccb4340473602f803e54f5d88202647cc6c9a
treefe375d7b53e11ef89035c76a744ae41bf114560e
parentfea657f5f46eda8f116eeebb01c6e2c5cff69997
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>
scripts/kernel-doc