From: neil Date: Sun, 29 Oct 2000 09:56:00 +0000 (+0000) Subject: * cpplex.c (save_comment): Don't store new lines in C++ comments. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a543b315a64c3e51edb6ca5a4f30a022b85dada6;p=thirdparty%2Fgcc.git * cpplex.c (save_comment): Don't store new lines in C++ comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37122 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a9cf24dab965..2172a8e272af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2000-10-29 Neil Booth + + * cpplex.c (save_comment): Don't store new lines in C++ comments. + 2000-10-29 Michael Hayes * integrate.c (copy_insn_list): Copy the unchanging flag for calls. diff --git a/gcc/cpplex.c b/gcc/cpplex.c index fa737a98f29e..ac8c3c48406f 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;