command was trying to parse their options and failing. (Commands
that aren't just disabled but have no option string even in the allyesconfig
case need an OPTSTR of 0.)
This is probably only a partial fix, there's some design work to think through
here.
for (;;) {
struct flag *flist, *aflist, *offlist;
for (;;) {
struct flag *flist, *aflist, *offlist;
unsigned bit;
*command = *flags = *allflags = 0;
unsigned bit;
*command = *flags = *allflags = 0;
bit = 0;
printf("// %s %s %s\n", command, flags, allflags);
bit = 0;
printf("// %s %s %s\n", command, flags, allflags);
- mgaps = mark_gaps(flags, allflags);
+ if (*flags != ' ') mgaps = mark_gaps(flags, allflags);
+ else if (*allflags != ' ') mgaps = allflags;
// If command disabled, use allflags for OLDTOY()
// If command disabled, use allflags for OLDTOY()
- printf("#undef OPTSTR_%s\n#define OPTSTR_%s \"%s\"\n",
- command, command, strcmp(flags, " ") ? mgaps : allflags);
- free(mgaps);
+ printf("#undef OPTSTR_%s\n#define OPTSTR_%s ", command, command);
+ if (mgaps) printf("\"%s\"\n", mgaps);
+ else printf("0\n");
+ if (mgaps != allflags) free(mgaps);
flist = digest(flags);
offlist = aflist = digest(allflags);
flist = digest(flags);
offlist = aflist = digest(allflags);