Skip to content

Commit 8d295fb

Browse files
mchehabJonathan Corbet
authored andcommitted
kernel-doc: better handle '::' sequences
Right now, if one of the following headers end with a '::', the kernel-doc script will do the wrong thing: description|context|returns?|notes?|examples? The real issue is with examples, as people could try to write something like: example:: /* Some C code */ and this won't be properly evaluated. So, improve the regex to not catch '\w+::' regex for the above identifiers. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/2cf44cf1fa42588632735d4fbc8e84304bdc235f.1616696051.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 4b9d49d commit 8d295fb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/kernel-doc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ my $doc_com_body = '\s*\* ?';
392392
my $doc_decl = $doc_com . '(\w+)';
393393
# @params and a strictly limited set of supported section names
394394
my $doc_sect = $doc_com .
395-
'\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:(.*)';
395+
'\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:]*)$';
396396
my $doc_content = $doc_com_body . '(.*)';
397397
my $doc_block = $doc_com . 'DOC:\s*(.*)?';
398398
my $doc_inline_start = '^\s*/\*\*\s*$';

0 commit comments

Comments
 (0)