SkipToNewLine() fixed: did not work with a / at the end of a line
authorceriel <none@none>
Fri, 28 Oct 1994 15:26:36 +0000 (15:26 +0000)
committerceriel <none@none>
Fri, 28 Oct 1994 15:26:36 +0000 (15:26 +0000)
lang/cem/cemcom.ansi/skip.c
lang/cem/cpp.ansi/skip.c

index f96878a..c3687fd 100644 (file)
@@ -81,12 +81,13 @@ SkipToNewLine()
                        delim = ch;
                        garbage = 1;
                } else if (ch == '/') {
-                       if ((ch = GetChar()) == '*'
+                       if (GetChar() == '*'
                            && !InputLevel
                        ) {
                                skipcomment();
                                continue;
                        }
+                       else UnGetChar();
                }
                else if (ch == TOKSEP && InputLevel) {
                        continue;
index f03089b..e9990ce 100644 (file)
@@ -74,10 +74,11 @@ SkipToNewLine()
                        delim = ch;
                        garbage = 1;
                } else if (ch == '/') {
-                       if ((ch = GetChar()) == '*' && !InputLevel) {
+                       if (GetChar() == '*' && !InputLevel) {
                                skipcomment();
                                continue;
                        }
+                       else UnGetChar();
                }
                else if (ch == TOKSEP && InputLevel) {
                        continue;