OSDN Git Service

* cpplex.c (save_comment): Don't store new lines in C++ comments.
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 Oct 2000 09:56:00 +0000 (09:56 +0000)
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 29 Oct 2000 09:56:00 +0000 (09:56 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37122 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cpplex.c

index a9cf24d..2172a8e 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 fa737a9..ac8c3c4 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;