public
/
ack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1cb247f
)
fixed two little bugs
author
eck
<none@none>
Fri, 31 Aug 1990 10:27:12 +0000
(10:27 +0000)
committer
eck
<none@none>
Fri, 31 Aug 1990 10:27:12 +0000
(10:27 +0000)
lang/cem/cpp.ansi/domacro.c
patch
|
blob
|
history
lang/cem/cpp.ansi/preprocess.c
patch
|
blob
|
history
diff --git
a/lang/cem/cpp.ansi/domacro.c
b/lang/cem/cpp.ansi/domacro.c
index
1690f89
..
4447394
100644
(file)
--- a/
lang/cem/cpp.ansi/domacro.c
+++ b/
lang/cem/cpp.ansi/domacro.c
@@
-203,9
+203,20
@@
int to_endif;
on the same level.
*/
id = findidf(tk.tk_str);
+ if (id == (struct idf *)0) {
+ /* invalid word seen after the '#' */
+ error("%s: unknown control", tk.tk_str);
+ }
free(tk.tk_str);
+ if (id == (struct idf *)0) continue;
switch(id->id_resmac) {
- default:
+ case K_DEFINE:
+ case K_ERROR:
+ case K_INCLUDE:
+ case K_LINE:
+ case K_PRAGMA:
+ case K_UNDEF:
+ case K_FILE:
SkipToNewLine();
break;
case K_IF:
diff --git
a/lang/cem/cpp.ansi/preprocess.c
b/lang/cem/cpp.ansi/preprocess.c
index
f80ec00
..
b39d5da
100644
(file)
--- a/
lang/cem/cpp.ansi/preprocess.c
+++ b/
lang/cem/cpp.ansi/preprocess.c
@@
-215,10
+215,10
@@
preprocess(fn)
case STCHAR:
{
register int stopc = c;
- int escaped
= 0
;
+ int escaped;
do {
-
+ escaped = 0;
echo(c);
c = GetChar();
if (c == '\n') {
@@
-230,14
+230,14
@@
preprocess(fn)
flush((int)(op-_obuf));
return;
}
- if (
!escaped &&
c == '\\') {
+ if (c == '\\') {
echo(c);
c = GetChar();
if (c == '\n') {
++LineNumber;
lineno++;
} else escaped = 1;
- }
else escaped = 0;
+ }
} while (escaped || c != stopc);
echo(c);
if (c == '\n')