2008-01-15 Bean <bean123ch@gmail.com>

* normal/execute.c (grub_script_exec_argument_to_string): Check for undefined variable.
	(grub_script_execute_cmdline): Reset grub_errno.

	* normal/main.c (read_config_file): Reset grub_errno.

	* normal/parse.y (script_init): New.
	(script): Move function and menuentry here.
	(delimiter): New.
	(command): Add delimiter at the end of command.
	(commands): Adjust to match the new command.
	(commandblock): Remove grub_script_lexer_record_start.
	(menuentry): Add grub_script_lexer_record_start, use the new commands.
	(if): Use the new commands.

	* conf/common.rmk (pkgdata_MODULES): Add echo.mod.
This commit is contained in:
bean 2008-01-15 15:32:17 +00:00
parent df6ecfc6f4
commit a83ccafd50
6 changed files with 119 additions and 40 deletions

View file

@ -49,7 +49,8 @@ grub_script_execute_argument_to_string (struct grub_script_arg *arg)
if (argi->type == 1)
{
val = grub_env_get (argi->str);
size += grub_strlen (val);
if (val)
size += grub_strlen (val);
}
else
size += grub_strlen (argi->str);
@ -67,7 +68,8 @@ grub_script_execute_argument_to_string (struct grub_script_arg *arg)
if (argi->type == 1)
{
val = grub_env_get (argi->str);
grub_strcat (chararg, val);
if (val)
grub_strcat (chararg, val);
}
else
grub_strcat (chararg, argi->str);
@ -99,6 +101,9 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd)
grubcmd = grub_command_find (cmdline->cmdname);
if (! grubcmd)
{
/* Ignore errors. */
grub_errno = GRUB_ERR_NONE;
/* It's not a GRUB command, try all functions. */
func = grub_script_function_find (cmdline->cmdname);
if (! func)