From: ceriel Date: Mon, 15 Jan 1990 17:01:36 +0000 (+0000) Subject: bug fix: #if defined(...) did not work properly X-Git-Tag: release-5-5~1942 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b5135607b40ecd688ef88f70ea4bd0fd23500e89;p=ack.git bug fix: #if defined(...) did not work properly --- diff --git a/util/cpp/replace.c b/util/cpp/replace.c index a8bccb1ac..8c4dd96f3 100644 --- a/util/cpp/replace.c +++ b/util/cpp/replace.c @@ -76,31 +76,38 @@ replace(idef) } if (mac->mc_flag & FUNC) { struct idf *param; - extern struct idf *GetIdentifier(); + char *nam; + extern char *GetIdentifier(); + extern struct idf *str2idf(); UnknownIdIsZero = 0; - param = GetIdentifier(); + nam = GetIdentifier(); + if (nam) { + param = findidf(nam); + } + else param = 0; UnknownIdIsZero = 1; if (c == '(') { LoadChar(c); c = skipspaces(c, 0); if (c != ')') error(") missing"); } - if (! param) { + if (! nam) { error("identifier missing"); } repl = new_mlist(); if (param && param->id_macro) - reptext = "1"; + reptext = "1 "; else - reptext = "0"; - InsertText(reptext, 1); + reptext = "0 "; + InsertText(reptext, 2); InputLevel++; repl->m_level = InputLevel; repl->next = ReplList; ReplList = repl; repl->m_mac = mac; + if (nam) free(nam); return 1; } actpars = getactuals(idef); /* get act.param. list */