]> git.ozlabs.org Git - petitboot/blobdiff - discover/yaboot-parser.c
discover/yaboot: Clear globals_done when we see an image definition
[petitboot] / discover / yaboot-parser.c
index e52187fff6b61203325e13019fa472ca95c9ad0f..eaefbf0041572cfbcd7dd3fdf3a376d7bd657718 100644 (file)
@@ -1,4 +1,6 @@
-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
 
 #include <assert.h>
 #include <stdlib.h>
@@ -102,7 +104,8 @@ static void yaboot_finish(struct conf_context *conf)
        const char *default_label;
        struct boot_option *opt;
 
-       assert(state->opt);
+       if (!state->opt)
+               return;
 
        opt = state->opt->option;
        assert(opt);
@@ -194,11 +197,10 @@ static void yaboot_process_pair(struct conf_context *conf, const char *name,
        if (!conf_param_in_list(state->known_names, name))
                return;
 
-       state->globals_done = 1;
-
        /* image */
-
        if (streq(name, "image")) {
+               /* an image section finishes our global defintions */
+               state->globals_done = 1;
 
                /* First finish any previous image. */
                if (opt)