]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-02-10 Vladimir Serbinenko <phcoder@gmail.com>
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 10 Feb 2010 17:09:44 +0000 (18:09 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 10 Feb 2010 17:09:44 +0000 (18:09 +0100)
* script/execute.c (grub_script_execute_cmdline): Use grub_print_error
to show messages instead of discarding them.
Process errors after executing command and not before. Keep old method
too as precaution.

ChangeLog
script/execute.c

index 793018ca976f1b2fcb5eed24c3aed3040bd41e13..b3e77335b0f78a015ebd5dff762a231f02d2ad04 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-02-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * script/execute.c (grub_script_execute_cmdline): Use grub_print_error
+       to show messages instead of discarding them.
+       Process errors after executing command and not before. Keep old method
+       too as precaution.
+
 2010-02-09  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * configure.ac: Check for ft2build.h.
index ee7e099bce22afe7bc990b37e5907385c343842d..a0773c191d66303a1ec5dfe3c358927587fd5999 100644 (file)
@@ -100,8 +100,8 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd)
   grubcmd = grub_command_find (cmdname);
   if (! grubcmd)
     {
-      /* Ignore errors.  */
-      grub_errno = GRUB_ERR_NONE;
+      /* Shouldn't happen but precaution is good.  */
+      grub_print_error ();
 
       /* It's not a GRUB command, try all functions.  */
       func = grub_script_function_find (cmdname);
@@ -156,6 +156,11 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd)
     grub_free (args[i]);
   grub_free (args);
 
+  if (grub_errno == GRUB_ERR_TEST_FAILURE)
+    grub_errno = GRUB_ERR_NONE;
+
+  grub_print_error ();
+
   grub_snprintf (errnobuf, sizeof (errnobuf), "%d", ret);
   grub_env_set ("?", errnobuf);