2005-08-20 Yoshinori K. Okuji <okuji@enbug.org>

* loader/powerpc/ieee1275/linux.c (grub_rescue_cmd_linux): Specify
        the boot file by the option BOOT_IMAGE. Use grub_stpcpy instead of
        grub_strcat.

        * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Specify the boot
        file by the option BOOT_IMAGE. Use grub_stpcpy instead of
        grub_strcpy and grub_strlen. Take it into account that a space
        character is inserted as a delimiter.
This commit is contained in:
okuji 2005-08-20 08:25:51 +00:00
parent 6a85ce7953
commit 16ccb8b138
4 changed files with 36 additions and 18 deletions

View file

@ -108,6 +108,7 @@ grub_rescue_cmd_linux (int argc, char *argv[])
grub_addr_t entry;
int found_addr = 0;
int size;
char *dest;
grub_dl_ref (my_mod);
@ -214,18 +215,22 @@ grub_rescue_cmd_linux (int argc, char *argv[])
}
}
size = 0;
size = sizeof ("BOOT_IMAGE=") + grub_strlen (argv[0]);
for (i = 0; i < argc; i++)
size += grub_strlen (argv[i]);
size += grub_strlen (argv[i]) + 1;
linux_args = grub_malloc (size + argc + 1);
if (!linux_args)
linux_args = grub_malloc (size);
if (! linux_args)
goto fail;
/* Specify the boot file. */
dest = grub_stpcpy (linux_args, "BOOT_IMAGE=");
dest = grub_stpcpy (dest, argv[0]);
for (i = 1; i < argc; i++)
{
grub_strcat (linux_args, argv[i]);
grub_strcat (linux_args, " ");
*dest++ = ' ';
dest = grub_stpcpy (dest, argv[i]);
}
fail: