find-file-doc-comments.pl: don't look for a doc comment before the file starts

Related to #232
This commit is contained in:
Chris White 2024-03-24 21:14:38 -04:00 committed by Théo Lebrun
parent f9267417fa
commit 973d00665e

View file

@ -105,6 +105,9 @@ sub main {
# back to it manually. Move to the first line that might be a doc comment. # back to it manually. Move to the first line that might be a doc comment.
--$lineno; --$lineno;
# If we ran off the beginning of the file, there's no doc comment.
next if $lineno <= 0;
# TODO make sure we're not still in the definition. # TODO make sure we're not still in the definition.
# E.g., memblock.h:for_each_mem_range(). The defintion is reported # E.g., memblock.h:for_each_mem_range(). The defintion is reported
# on the second line of the #define, not the first line. # on the second line of the #define, not the first line.