discover/grub2: Implement 'elif'
[petitboot] / discover / grub2 / script.c
index c0d6e1a4e4a31affa291713b0351f816ac16afed..239ae38f5e67306408e7c386abc050b03ec5d4d6 100644 (file)
@@ -277,10 +277,12 @@ int statement_if_execute(struct grub2_script *script,
        bool executed;
        int rc;
 
        bool executed;
        int rc;
 
-       conditional = st->conditional;
-
-       rc = statement_conditional_execute(script,
-                       conditional, &executed);
+       list_for_each_entry(&st->conditionals->list, conditional, list) {
+               rc = statement_conditional_execute(script,
+                               conditional, &executed);
+               if (executed)
+                       break;
+       }
 
        if (!executed && st->else_case)
                rc = statements_execute(script, st->else_case);
 
        if (!executed && st->else_case)
                rc = statements_execute(script, st->else_case);