From: eck Date: Wed, 21 Feb 1990 16:38:45 +0000 (+0000) Subject: fixed bugs, added No_Mem() X-Git-Tag: release-5-5~1815 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=64e1fa33d3eb9d863b43d15f2e6561b3f9a9e081;p=ack.git fixed bugs, added No_Mem() --- diff --git a/lang/cem/cpp.ansi/macro.str b/lang/cem/cpp.ansi/macro.str index 391c45080..32b867c5e 100644 --- a/lang/cem/cpp.ansi/macro.str +++ b/lang/cem/cpp.ansi/macro.str @@ -21,7 +21,6 @@ formal parameter in this text. */ struct macro { - struct macro *next; char * mc_text; /* the replacement text */ int mc_nps; /* number of formal parameters */ int mc_length; /* length of replacement text */ diff --git a/lang/cem/cpp.ansi/main.c b/lang/cem/cpp.ansi/main.c index 8a320505f..1008665eb 100644 --- a/lang/cem/cpp.ansi/main.c +++ b/lang/cem/cpp.ansi/main.c @@ -82,3 +82,8 @@ compile(argc, argv) if (source) WorkingDir = getwdir(dummy); preprocess(source); } + +No_Mem() /* called by alloc package */ +{ + fatal("out of memory"); +} diff --git a/lang/cem/cpp.ansi/options.c b/lang/cem/cpp.ansi/options.c index 736078e14..5f253c39a 100644 --- a/lang/cem/cpp.ansi/options.c +++ b/lang/cem/cpp.ansi/options.c @@ -41,7 +41,7 @@ do_option(text) { register char *cp = text, *name, *mactext; - if (class(*cp) != STIDF || class(*cp) == STELL) { + if (class(*cp) != STIDF && class(*cp) != STELL) { error("identifier missing in -D%s", text); break; } diff --git a/lang/cem/cpp.ansi/preprocess.c b/lang/cem/cpp.ansi/preprocess.c index d5ed78e13..ea4ede09d 100644 --- a/lang/cem/cpp.ansi/preprocess.c +++ b/lang/cem/cpp.ansi/preprocess.c @@ -53,7 +53,7 @@ do_pragma() *c_ptr = '\0'; while(c != '\n') { if (c_ptr + 1 - cur_line == size) { - cur_line = Realloc(cur_line, size + ITEXTSIZE); + cur_line = Realloc(cur_line, size += ITEXTSIZE); c_ptr = cur_line + size - 1; } *c_ptr++ = c; diff --git a/lang/cem/cpp.ansi/replace.c b/lang/cem/cpp.ansi/replace.c index 81e11b6de..3e2c3ac93 100644 --- a/lang/cem/cpp.ansi/replace.c +++ b/lang/cem/cpp.ansi/replace.c @@ -186,9 +186,10 @@ expand_defined(repl) } UnGetChar(); str = GetIdentifier(0); - if (str) - id = str2idf(str, 0); - else id = 0; + if (str) { + id = findidf(str); + free(str); + } else id = 0; assert(id || class(ch) == STELL); ch = GetChar(); ch = skipspaces(ch, 0);