]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* bin/autoscan.in (scan_c_file): Fix the handling of C comments.
authorAkim Demaille <akim@epita.fr>
Mon, 26 Nov 2001 10:51:14 +0000 (10:51 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 26 Nov 2001 10:51:14 +0000 (10:51 +0000)
Before, having a line containing the opening of a multi line
comment made the whole line be ignored.

ChangeLog
bin/autoscan.in

index 975038f18905ab03ac4f8ac0fe78b9eae67055b6..e9e54a02a1fb79940abb69dd22c4791646f48830 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 36ff771634ad55cdbdb6e4f1b7dbf013485b4b82..3c6d7b2b43dda57ac4c14ab85c22c6cf01220eaf 100644 (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*<([^>]*)>/)