From: Jim Wilson Date: Wed, 6 Apr 1994 23:01:45 +0000 (-0700) Subject: (discard_comments): Replace comments with a single space. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18e2b1c06ed8c34393fb517d1ff4d27bd04389f8;p=gcc.git (discard_comments): Replace comments with a single space. From-SVN: r6993 --- diff --git a/gcc/cccp.c b/gcc/cccp.c index 1901cf6059c..1380d201c9b 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -8170,14 +8170,16 @@ discard_comments (start, length, newlines) newline_fix (ibp); /* Delete any comment. */ if (cplusplus_comments && ibp[0] == '/') { - obp--; + /* Comments are equivalent to spaces. */ + obp[-1] = ' '; ibp++; while (ibp < limit && *ibp++ != '\n') ; break; } if (ibp[0] != '*' || ibp + 1 >= limit) break; - obp--; + /* Comments are equivalent to spaces. */ + obp[-1] = ' '; ibp++; while (ibp + 1 < limit) { if (ibp[0] == '*'