_mkflags_ had an issue for generating FLAG_xxxx macros for long options.

Only the first __long__ option, without any __short__ option had a proper
flag value, rest all were defined to ZERO. Becaus the _flist_ was not moved
to the next in this case.
This commit is contained in:
Ashwini Sharma 2014-04-09 07:40:02 -05:00
parent e6314da6fe
commit 882ca8bf5b

View File

@ -117,7 +117,13 @@ int main(int argc, char *argv[])
flist->lopt = flist->lopt->next; flist->lopt = flist->lopt->next;
} else sprintf(out, "#define FLAG_%s 0\n", aflist->lopt->command); } else sprintf(out, "#define FLAG_%s 0\n", aflist->lopt->command);
aflist->lopt = aflist->lopt->next; aflist->lopt = aflist->lopt->next;
if (!aflist->command) aflist = aflist->next; if (!aflist->command) {
aflist = aflist->next;
if (flist) {
flist = flist->next;
bit++;
}
}
} else if (aflist->command) { } else if (aflist->command) {
if (flist && (!aflist->command || *aflist->command == *flist->command)) if (flist && (!aflist->command || *aflist->command == *flist->command))
{ {