* bin/autoscan.in (scan_c_file): Fix the handling of C comments.

Before, having a line containing the opening of a multi line
comment made the whole line be ignored.
This commit is contained in:
Akim Demaille 2001-11-26 10:51:14 +00:00
parent 47b2167bee
commit 32598e1b56
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2001-11-26 Akim Demaille <akim@epita.fr>
* bin/autoscan.in (scan_c_file): Fix the handling of C comments.
Before, having a line containing the opening of a multi line
comment made the whole line be ignored.
2001-11-26 Akim Demaille <akim@epita.fr>
* doc/autoconf.texi (Using an Autotest Test Suite): New.

View File

@ -207,22 +207,21 @@ sub scan_c_file ($)
while ($_ = $file->getline)
{
# Strip out comments, approximately.
# Ending on this line.
if ($in_comment && m,\*/,)
# Strip out comments.
if ($in_comment && s,^.*?\*/,,)
{
s,.*\*/,,;
$in_comment = 0;
}
# The whole line is inside a commment.
next if $in_comment;
# All on one line.
s,/\*.*\*/,,g;
s,/\*.*?\*/,,g;
# Starting on this line.
if (m,/\*,)
if (s,/\*.*$,,)
{
$in_comment = 1;
}
# Continuing on this line.
next if $in_comment;
# Preprocessor directives.
if (/^\s*\#\s*include\s*<([^>]*)>/)