mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-20 22:48:22 +00:00
* grub-core/kern/main.c (grub_set_prefix_and_root): Strip trailing
platform from firmware path.
This commit is contained in:
1 parent
0789b67232
commit
be174e5ef3
2 files changed
+15
-1
No files matched your search
+10
-1
@@ -168,7 +168,16 @@ grub_set_prefix_and_root (void)
|
||||
else
|
||||
grub_free (fwdevice);
|
||||
if (fwpath && !path)
|
||||
path = fwpath;
|
||||
{
|
||||
grub_size_t len = grub_strlen (fwpath);
|
||||
while (len > 1 && fwpath[len - 1] == '/')
|
||||
fwpath[--len] = 0;
|
||||
if (len >= sizeof (GRUB_TARGET_CPU "-" GRUB_PLATFORM) - 1
|
||||
&& grub_memcmp (fwpath + len - (sizeof (GRUB_TARGET_CPU "-" GRUB_PLATFORM) - 1), GRUB_TARGET_CPU "-" GRUB_PLATFORM,
|
||||
sizeof (GRUB_TARGET_CPU "-" GRUB_PLATFORM) - 1) == 0)
|
||||
fwpath[len - (sizeof (GRUB_TARGET_CPU "-" GRUB_PLATFORM) - 1)] = 0;
|
||||
path = fwpath;
|
||||
}
|
||||
else
|
||||
grub_free (fwpath);
|
||||
if (device)
|
||||
|
||||
Reference in new issue
Block a user