Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 2b5f78e5 authored by André Almeida's avatar André Almeida Committed by Jonathan Corbet
Browse files

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: default avatarAndré Almeida <andrealmeid@collabora.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 2730ce01
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment