* grub-core/kern/emu/misc.c
(grub_make_system_path_relative_to_its_root): Revert r2882.
This commit is contained in:
parent
e138c45836
commit
5c81f8b349
2 changed files with 21 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-10-22 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/kern/emu/misc.c
|
||||||
|
(grub_make_system_path_relative_to_its_root): Revert r2882.
|
||||||
|
|
||||||
2010-10-22 Vladimir Serbinenko <phcoder@gmail.com>
|
2010-10-22 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/lib/relocator.c (grub_relocator_subchunk): Remove now
|
* grub-core/lib/relocator.c (grub_relocator_subchunk): Remove now
|
||||||
|
|
|
@ -406,7 +406,21 @@ grub_make_system_path_relative_to_its_root (const char *path)
|
||||||
|
|
||||||
/* buf is another filesystem; we found it. */
|
/* buf is another filesystem; we found it. */
|
||||||
if (st.st_dev != num)
|
if (st.st_dev != num)
|
||||||
|
{
|
||||||
|
/* offset == 0 means path given is the mount point.
|
||||||
|
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 (offset == 0)
|
||||||
|
{
|
||||||
|
free (buf);
|
||||||
|
free (buf2);
|
||||||
|
return xstrdup ("");
|
||||||
|
}
|
||||||
|
else
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
offset = p - buf;
|
offset = p - buf;
|
||||||
/* offset == 1 means root directory. */
|
/* offset == 1 means root directory. */
|
||||||
|
@ -434,10 +448,7 @@ grub_make_system_path_relative_to_its_root (const char *path)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This works around special-casing of "/" in Un*x. This function never
|
/* Remove trailing slashes, return empty string if root directory. */
|
||||||
prints trailing slashes (so that its output can be appended a slash
|
|
||||||
unconditionally). Each slash in it is considered a preceding slash,
|
|
||||||
and therefore the root directory is an empty string. */
|
|
||||||
len = strlen (buf3);
|
len = strlen (buf3);
|
||||||
while (len > 0 && buf3[len - 1] == '/')
|
while (len > 0 && buf3[len - 1] == '/')
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue