aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-10-29 09:56:00 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-10-29 09:56:00 +0000
commit3542203b30a788180f69c3298227c97eeefec03d (patch)
tree6c7809161e002cc8c18a3a5d38fdb78c36b62203 /gcc/cpplex.c
parent6f268adf3b95994c68ba45ad1ceaa18b776f6b29 (diff)
downloadgcc-3542203b30a788180f69c3298227c97eeefec03d.zip
gcc-3542203b30a788180f69c3298227c97eeefec03d.tar.gz
gcc-3542203b30a788180f69c3298227c97eeefec03d.tar.bz2
* cpplex.c (save_comment): Don't store new lines in C++ comments.
From-SVN: r37122
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index fa737a9..ac8c3c4 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -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;