Bladeren bron

SkipToNewLine() fixed: did not work with a / at the end of a line

ceriel 30 jaren geleden
bovenliggende
commit
c7b707c266
2 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  1. 2 1
      lang/cem/cemcom.ansi/skip.c
  2. 2 1
      lang/cem/cpp.ansi/skip.c

+ 2 - 1
lang/cem/cemcom.ansi/skip.c

@@ -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;

+ 2 - 1
lang/cem/cpp.ansi/skip.c

@@ -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;