]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-12-06 Felix Zielcke <fzielcke@z-51.de>
authorFelix Zielcke <fzielcke@z-51.de>
Sun, 6 Dec 2009 09:20:01 +0000 (10:20 +0100)
committerFelix Zielcke <fzielcke@z-51.de>
Sun, 6 Dec 2009 09:20:01 +0000 (10:20 +0100)
* util/misc.c (make_system_path_relative_to_its_root): Correctly cope with
mount points.

ChangeLog
util/misc.c

index 77b2165ab187e3039cbe60456a0d93b7b3571351..53667833e3be700fb692de329a0c673e95e877a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-06 Felix Zielcke <fzielcke@z-51.de>
+
+       * util/misc.c (make_system_path_relative_to_its_root): Correctly cope with
+       mount points.
+
 2009-12-05  Carles Pina i Estany <carles@pina.cat>
 
        * gettext/gettext.c: Include `<grub/list.h>'. Define grub_gettext_msg,
index 62685130647c64b462ca58f0ed4401c323c9749e..d46051efe36ddd1d5ff33ae3b73d59f543a138b8 100644 (file)
@@ -500,7 +500,17 @@ make_system_path_relative_to_its_root (const char *path)
 
       /* buf is another filesystem; we found it.  */
       if (st.st_dev != num)
-       break;
+       {
+         /* offset == 0 means path given is the mount point.  */
+         if (offset == 0)
+           {
+             free (buf);
+             free (buf2);
+             return strdup ("/");
+           }
+         else
+           break;
+       }
 
       offset = p - buf;
       /* offset == 1 means root directory.  */