]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-20 Robert Millan <rmh.grub@aybabtu.com>
authorRobert Millan <rmh@aybabtu.com>
Wed, 20 Jan 2010 14:40:00 +0000 (14:40 +0000)
committerRobert Millan <rmh@aybabtu.com>
Wed, 20 Jan 2010 14:40:00 +0000 (14:40 +0000)
* util/misc.c (make_system_path_relative_to_its_root): Work around
special-casing of "/", as previous incarnation of this routine did.

ChangeLog
util/misc.c

index 7274a9920d001a75506103554b1d7b11324e3199..c4048a66e514df136c5a1d062648861612083eeb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-20  Robert Millan  <rmh.grub@aybabtu.com>
+
+       * util/misc.c (make_system_path_relative_to_its_root): Work around
+       special-casing of "/", as previous incarnation of this routine did.
+
 2010-01-20  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Fix any-emu compilation.
index 0b682c445f6156025e84223408b77434a106e69b..c5ab62e42c131ab52d186f709ec4549ec5055456 100644 (file)
@@ -577,6 +577,13 @@ make_system_path_relative_to_its_root (const char *path)
       len--;
     }
 
+  /* This works around special-casing of "/" in Un*x.  This function never
+     prints trailing slashes (so that its output can be appended a slash
+     unconditionally).  Each slash in is considered a preceding slash, and
+     therefore the root directory is an empty string.  */
+  if (!strcmp (buf3, "/"))
+    buf3[0] = '\0';
+
   return buf3;
 }