2006-05-29 Vesa Jaaskelainen <chaac@nic.fi>
* include/grub/script.h (grub_script_cmdif): Renamed field 'bool' to 'exec_to_evaluate'. Renamed field 'true' to 'exec_on_true'. Renamed field 'false' to 'exec_on_false'. (grub_script_create_cmdif): Renamed argument names to reflect above changes. * normal/execute.c (grub_script_execute_cmdif): Likewise. * normal/script.c (grub_script_create_cmdif): Likewise.
This commit is contained in:
parent
118f4fb31e
commit
f09771a102
4 changed files with 36 additions and 24 deletions
|
@ -192,19 +192,19 @@ grub_err_t
|
|||
grub_script_execute_cmdif (struct grub_script_cmd *cmd)
|
||||
{
|
||||
struct grub_script_cmdif *cmdif = (struct grub_script_cmdif *) cmd;
|
||||
char *bool;
|
||||
char *result;
|
||||
|
||||
/* Check if the commands results in a true or a false. The value is
|
||||
read from the env variable `RESULT'. */
|
||||
grub_script_execute_cmd (cmdif->bool);
|
||||
bool = grub_env_get ("?");
|
||||
read from the env variable `?'. */
|
||||
grub_script_execute_cmd (cmdif->exec_to_evaluate);
|
||||
result = grub_env_get ("?");
|
||||
|
||||
/* Execute the `if' or the `else' part depending on the value of
|
||||
`RESULT'. */
|
||||
if (bool && ! grub_strcmp (bool, "0"))
|
||||
return grub_script_execute_cmd (cmdif->true);
|
||||
`?'. */
|
||||
if (result && ! grub_strcmp (result, "0"))
|
||||
return grub_script_execute_cmd (cmdif->exec_on_true);
|
||||
else
|
||||
return grub_script_execute_cmd (cmdif->false);
|
||||
return grub_script_execute_cmd (cmdif->exec_on_false);
|
||||
}
|
||||
|
||||
/* Execute the menu entry generate statement. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue