[Toybox] [Patch] - mkflags, for long options
Ashwini Sharma
ak.ashwini1981 at gmail.com
Tue Apr 8 22:10:54 PDT 2014
Hi Rob,
_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.
The issue is fixed in the patch.
@@ -117,7 +117,12 @@
flist->lopt = flist->lopt->next;
} else sprintf(out, "#define FLAG_%s 0\n", aflist->lopt->command);
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) {
if (flist && (!aflist->command || *aflist->command ==
*flist->command))
{
regards,
Ashwini
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140409/c227e2f3/attachment-0004.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mkflags.c.patch
Type: application/octet-stream
Size: 661 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140409/c227e2f3/attachment-0005.obj>
More information about the Toybox
mailing list