From: wessels <> Date: Sun, 24 Jan 1999 11:29:43 +0000 (+0000) Subject: fix ifdef handling in parser X-Git-Tag: SQUID_3_0_PRE1~2348 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b3942d3ebf076a586411a97850fa55d1ab5a6c5;p=thirdparty%2Fsquid.git fix ifdef handling in parser --- diff --git a/src/cf_gen.cc b/src/cf_gen.cc index a539b5e278..c772c7ab05 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -1,5 +1,5 @@ /* - * $Id: cf_gen.cc,v 1.30 1999/01/13 23:24:10 wessels Exp $ + * $Id: cf_gen.cc,v 1.31 1999/01/24 04:29:43 wessels Exp $ * * DEBUG: none * AUTHOR: Max Okumoto @@ -433,21 +433,19 @@ gen_parse(Entry * head, FILE * fp) "\tint\tresult = 1;\n" "\tchar\t*token;\n" "\tdebug(0,10)(\"parse_line: %%s\\n\", buff);\n" - "\tif ((token = strtok(buff, w_space)) == NULL) {\n" - "\t\t/* ignore empty lines */\n" - "\t\t(void) 0;\n" + "\tif ((token = strtok(buff, w_space)) == NULL)\n" + "\t\t(void) 0;\t/* ignore empty lines */\n" ); for (entry = head; entry != NULL; entry = entry->next) { if (strcmp(entry->name, "comment") == 0) continue; - fprintf(fp, - "\t} else if (!strcmp(token, \"%s\")) {\n", + if (entry->ifdef) + fprintf(fp, "#if %s\n", entry->ifdef); + fprintf(fp, "\telse if (!strcmp(token, \"%s\"))\n", entry->name ); assert(entry->loc); - if (entry->ifdef) - fprintf(fp, "#if %s\n", entry->ifdef); if (strcmp(entry->loc, "none") == 0) { fprintf(fp, "\t\tparse_%s();\n", @@ -464,9 +462,8 @@ gen_parse(Entry * head, FILE * fp) } fprintf(fp, - "\t} else {\n" + "\telse\n" "\t\tresult = 0; /* failure */\n" - "\t}\n" "\treturn(result);\n" "}\n\n" );