aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-04-06 16:01:45 -0700
committerJim Wilson <wilson@gcc.gnu.org>1994-04-06 16:01:45 -0700
commit18e2b1c06ed8c34393fb517d1ff4d27bd04389f8 (patch)
tree2333d9c5f293d513197472f69fe338d2f1a55436 /gcc
parent1e0181030e9ca94c59ccac1d244d5d7678a49209 (diff)
downloadgcc-18e2b1c06ed8c34393fb517d1ff4d27bd04389f8.zip
gcc-18e2b1c06ed8c34393fb517d1ff4d27bd04389f8.tar.gz
gcc-18e2b1c06ed8c34393fb517d1ff4d27bd04389f8.tar.bz2
(discard_comments): Replace comments with a single space.
From-SVN: r6993
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 1901cf6..1380d20 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] == '*'