mirror of
git://git.sv.gnu.org/autoconf
synced 2024-12-03 02:00:36 +08:00
* 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:
parent
47b2167bee
commit
32598e1b56
@ -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>
|
2001-11-26 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* doc/autoconf.texi (Using an Autotest Test Suite): New.
|
* doc/autoconf.texi (Using an Autotest Test Suite): New.
|
||||||
|
@ -207,22 +207,21 @@ sub scan_c_file ($)
|
|||||||
|
|
||||||
while ($_ = $file->getline)
|
while ($_ = $file->getline)
|
||||||
{
|
{
|
||||||
# Strip out comments, approximately.
|
# Strip out comments.
|
||||||
# Ending on this line.
|
if ($in_comment && s,^.*?\*/,,)
|
||||||
if ($in_comment && m,\*/,)
|
|
||||||
{
|
{
|
||||||
s,.*\*/,,;
|
|
||||||
$in_comment = 0;
|
$in_comment = 0;
|
||||||
}
|
}
|
||||||
|
# The whole line is inside a commment.
|
||||||
|
next if $in_comment;
|
||||||
# All on one line.
|
# All on one line.
|
||||||
s,/\*.*\*/,,g;
|
s,/\*.*?\*/,,g;
|
||||||
|
|
||||||
# Starting on this line.
|
# Starting on this line.
|
||||||
if (m,/\*,)
|
if (s,/\*.*$,,)
|
||||||
{
|
{
|
||||||
$in_comment = 1;
|
$in_comment = 1;
|
||||||
}
|
}
|
||||||
# Continuing on this line.
|
|
||||||
next if $in_comment;
|
|
||||||
|
|
||||||
# Preprocessor directives.
|
# Preprocessor directives.
|
||||||
if (/^\s*\#\s*include\s*<([^>]*)>/)
|
if (/^\s*\#\s*include\s*<([^>]*)>/)
|
||||||
|
Loading…
Reference in New Issue
Block a user