[2577] 2009-09-08 Colin Watson <[email protected]>

Colin Watson <[email protected]> Tue, 08 Sep 2009 19:10:35 +0000
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2577
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2577
Author:   cjwatson
Date:     2009-09-08 19:10:34 +0000 (Tue, 08 Sep 2009)
Log Message:
-----------
2009-09-08  Colin Watson  <[email protected]>

	* script/sh/execute.c (grub_script_execute_cmdline): Set "?" in
	unknown-command case.  Fixes bug #27320.

Ticket Links:
:-----------
    http://savannah.gnu.org/bugs/?27320

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/script/sh/execute.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-09-08 15:00:28 UTC (rev 2576)
+++ trunk/grub2/ChangeLog	2009-09-08 19:10:34 UTC (rev 2577)
@@ -1,3 +1,8 @@
+2009-09-08  Colin Watson  <[email protected]>
+
+	* script/sh/execute.c (grub_script_execute_cmdline): Set "?" in
+	unknown-command case.  Fixes bug #27320.
+
 2009-09-08  Felix Zielcke  <[email protected]>
 
 	* kern/rescue_parser.c (grub_rescue_parse_line): Only suggest to try

Modified: trunk/grub2/script/sh/execute.c
===================================================================
--- trunk/grub2/script/sh/execute.c	2009-09-08 15:00:28 UTC (rev 2576)
+++ trunk/grub2/script/sh/execute.c	2009-09-08 19:10:34 UTC (rev 2577)
@@ -122,6 +122,10 @@
 	      grub_errno = GRUB_ERR_NONE;
 	    }
 	  grub_free (assign);
+
+	  grub_sprintf (errnobuf, "%d", grub_errno);
+	  grub_env_set ("?", errnobuf);
+
 	  return 0;
 	}
     }