From 32598e1b56aef31db295fec1f54d0caa91b8c98a Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 26 Nov 2001 10:51:14 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ bin/autoscan.in | 15 +++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 975038f1..e9e54a02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-11-26 Akim Demaille + + * 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 * doc/autoconf.texi (Using an Autotest Test Suite): New. diff --git a/bin/autoscan.in b/bin/autoscan.in index 36ff7716..3c6d7b2b 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -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*<([^>]*)>/)