discover/grub2: unknown commands should fail
authorJeremy Kerr <jk@ozlabs.org>
Tue, 17 Sep 2013 06:51:23 +0000 (14:51 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 24 Sep 2013 05:14:59 +0000 (13:14 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/grub2/script.c

index 67b4b7801f8717d51df2cdbfc68edab97988f082..5fb13aa4f0979e24451471df8db627c4802ee26b 100644 (file)
@@ -246,7 +246,7 @@ int statement_simple_execute(struct grub2_script *script,
        entry = script_lookup_function(script, st->argv->argv[0]);
        if (!entry) {
                fprintf(stderr, "undefined function '%s'\n", st->argv->argv[0]);
        entry = script_lookup_function(script, st->argv->argv[0]);
        if (!entry) {
                fprintf(stderr, "undefined function '%s'\n", st->argv->argv[0]);
-               return 0;
+               return 1;
        }
 
        rc = entry->fn(script, entry->data, st->argv->argc, st->argv->argv);
        }
 
        rc = entry->fn(script, entry->data, st->argv->argc, st->argv->argv);