]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-probe.c (escape_of_path): Don't add ieee1275/.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 5 Jun 2012 09:31:10 +0000 (11:31 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 5 Jun 2012 09:31:10 +0000 (11:31 +0200)
(probe): Add ieee1275 to OFW devices.

ChangeLog
util/grub-probe.c

index 1e3e625adea2ffff5c623864d4e0588ea4f9eb73..f35170d6812066fa904ff32f1683bcc76afb8885 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-05  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-probe.c (escape_of_path): Don't add ieee1275/.
+       (probe): Add ieee1275 to OFW devices.
+
 2012-06-04  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/ieee1275/ofpath.c (of_path_of_scsi): Fix wrong format specifier.
index 8beb1bc60f4a277928abb8aec8deafd3fc92f340..4db259bd2f923814c1b0ccf04b5c8a750f834409 100644 (file)
@@ -157,11 +157,10 @@ escape_of_path (const char *orig_path)
   if (!strchr (orig_path, ','))
     return (char *) xstrdup (orig_path);
 
-  new_path = xmalloc (strlen (orig_path) * 2 + sizeof ("ieee1275/"));
+  new_path = xmalloc (strlen (orig_path) * 2 + 1);
 
   p = orig_path;
-  grub_strcpy (new_path, "ieee1275/");
-  d = new_path + sizeof ("ieee1275/") - 1;
+  d = new_path;
   while ((c = *p++) != '\0')
     {
       if (c == ',')
@@ -499,9 +498,14 @@ probe (const char *path, char **device_names, char delim)
 
          if (ofpath)
            {
+             char *tmp = xmalloc (strlen (ofpath) + sizeof ("ieee1275/"));
+             char *p;
+             p = stpcpy (tmp, "ieee1275/");
+             strcpy (p, ofpath);
              printf ("--hint-ieee1275='");
-             print_full_name (ofpath, dev);
+             print_full_name (tmp, dev);
              printf ("' ");
+             free (tmp);
            }
 
          biosname = guess_bios_drive (*curdev);
@@ -611,7 +615,12 @@ probe (const char *path, char **device_names, char delim)
 
          if (ofpath)
            {
-             print_full_name (ofpath, dev);
+             char *tmp = xmalloc (strlen (ofpath) + sizeof ("ieee1275/"));
+             char *p;
+             p = stpcpy (tmp, "ieee1275/");
+             strcpy (p, ofpath);
+             print_full_name (tmp, dev);
+             free (tmp);
              putchar (delim);
            }