aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-02-08 10:53:26 -0600
committerRob Landley <rob@landley.net>2014-02-08 10:53:26 -0600
commit5a2583ac4ff866caee57b465f429f75417c629ad (patch)
tree6514831f768700d7e159dfe8a2bcf9cf5fef48ec
parentb6c8a8609fbfcbaf054e254f74974394c8932712 (diff)
downloadtoybox-5a2583ac4ff866caee57b465f429f75417c629ad.tar.gz
Fix segfault with single build of a command with bare longopts.
-rw-r--r--scripts/mkflags.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/mkflags.c b/scripts/mkflags.c
index eca59603..17067861 100644
--- a/scripts/mkflags.c
+++ b/scripts/mkflags.c
@@ -111,7 +111,8 @@ int main(int argc, char *argv[])
flist->lopt = flist->lopt->next;
} else printf("#define FLAG_%s 0\n", aflist->lopt->command);
aflist->lopt = aflist->lopt->next;
- } else {
+ if (!aflist->command) aflist = aflist->next;
+ } else if (aflist->command) {
if (flist && (!aflist->command || *aflist->command == *flist->command))
{
if (aflist->command)