From 24dd6b4cb54877ea5d38ec34f525918dc78d2f0a Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 18 Feb 1991 15:50:39 +0000 Subject: [PATCH] Fixed problem with multiple TOKSEP's --- lang/cem/cemcom.ansi/Makefile | 2 +- lang/cem/cemcom.ansi/replace.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lang/cem/cemcom.ansi/Makefile b/lang/cem/cemcom.ansi/Makefile index b46c2314b..86158d67d 100644 --- a/lang/cem/cemcom.ansi/Makefile +++ b/lang/cem/cemcom.ansi/Makefile @@ -68,7 +68,7 @@ TABGEN = $(EMHOME)/bin/tabgen PROF = #-pg CDEFS = $(EM_INCLUDES) $(LIB_INCLUDES) CFLAGS = $(CDEFS) $(COPTIONS) $(PROF) -O -LDFLAGS = -i $(PROF) +LDFLAGS = $(PROF) # Grammar files and their objects LSRC = tokenfile.g declar.g statement.g expression.g program.g ival.g diff --git a/lang/cem/cemcom.ansi/replace.c b/lang/cem/cemcom.ansi/replace.c index 05afb8616..9f7a86503 100644 --- a/lang/cem/cemcom.ansi/replace.c +++ b/lang/cem/cemcom.ansi/replace.c @@ -303,10 +303,12 @@ actual(repl) It keeps in account the opening and closing brackets, preprocessor numbers, strings and character constants. */ - register int ch; + register int ch = 0; register int level = 0, nostashraw = 0; + int lastch; while (1) { + lastch = ch; ch = GetChar(); if (Unstacked) { @@ -483,8 +485,10 @@ a_new_line: ch = GetChar(); return ')'; } stash(repl, ch, !nostashraw); - } else + } else { + if (lastch == TOKSEP && ch == TOKSEP) continue; stash(repl, ch, !nostashraw); + } } } -- 2.34.1