Skip to content

Commit

Permalink
scanspool: Detect empty files
Browse files Browse the repository at this point in the history
see #288
  • Loading branch information
Julien-Elie committed Dec 27, 2023
1 parent 6be48d3 commit 59efc75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/pod/news.pod
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ Jesse Rehmer for the bug report and Bo Lindbergh for the fix.

=item *

B<scanspool> now detects empty files in a tradspool news spool.

=item *

B<innd> no longer malfunctions nor throttles when the maximum number of file
descriptors supported by the system is reached. If needing to use more file
descriptors than the default system limit, a new C<LARGE_FD_SETSIZE> option
Expand Down
8 changes: 7 additions & 1 deletion frontends/scanspool.in
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,11 @@ sub check_spool {
next;
}

@group = ();

# read until the Newsgroups header field is found
AREADLINE:
while ($aline = <$ARTICLE>) {

# catch the Newsgroups header field
if ($aline =~ /^Newsgroups:\w*\W/io) {
# convert $aline into a comma separated list of groups
Expand Down Expand Up @@ -460,6 +461,11 @@ sub check_spool {
}
}

if (scalar(@group) == 0) {
problem("WARNING: $filename: no Newsgroups header field "
. "(empty file)");
}

# close the article
close $ARTICLE;
}
Expand Down

0 comments on commit 59efc75

Please sign in to comment.