* cpplex.c (save_comment): Don't store new lines in C++ comments.
authorNeil Booth <neilb@earthling.net>
Sun, 29 Oct 2000 09:56:00 +0000 (09:56 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sun, 29 Oct 2000 09:56:00 +0000 (09:56 +0000)
From-SVN: r37122

gcc/ChangeLog
gcc/cpplex.c

index a9cf24dab96581abfc0a25588f03af532f2ae9c0..2172a8e272afd7f143d454143b817a0a725ffd77 100644 (file)
@@ -1,3 +1,7 @@
+2000-10-29  Neil Booth  <neilb@earthling.net>
+
+       * cpplex.c (save_comment): Don't store new lines in C++ comments.
+
 2000-10-29  Michael Hayes  <mhayes@redhat.com>
 
        * integrate.c (copy_insn_list): Copy the unchanging flag for calls.
index fa737a98f29e27178d8ae1c25c8c220169d313b5..ac8c3c48406f0f6f5c641214537f92a93b39069d 100644 (file)
@@ -724,6 +724,10 @@ save_comment (pfile, token, from)
   unsigned int len;
   
   len = pfile->buffer->cur - from + 1; /* + 1 for the initial '/'.  */
+  /* C++ comments probably (not definitely) have moved past a new
+     line, which we don't want to save in the comment.  */
+  if (pfile->buffer->read_ahead != EOF)
+    len--;
   buffer = _cpp_pool_alloc (pfile->string_pool, len);
   
   token->type = CPP_COMMENT;