Fixed problem with multiple TOKSEP's
authorceriel <none@none>
Mon, 18 Feb 1991 15:50:39 +0000 (15:50 +0000)
committerceriel <none@none>
Mon, 18 Feb 1991 15:50:39 +0000 (15:50 +0000)
lang/cem/cemcom.ansi/Makefile
lang/cem/cemcom.ansi/replace.c

index b46c231..86158d6 100644 (file)
@@ -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
index 05afb86..9f7a865 100644 (file)
@@ -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);
+               }
        }
 }