* grub-core/fs/ufs.c (grub_ufs_find_file): Fix handling of double slash.

* grub-core/fs/minix.c (grub_minix_find_file): Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-05-10 23:33:44 +02:00
parent 8aeb18379b
commit 3244fe96e7
3 changed files with 22 additions and 13 deletions

View file

@ -471,12 +471,10 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
grub_strcpy (fpath, path);
/* Skip the first slash. */
if (name[0] == '/')
{
name++;
if (!*name)
return 0;
}
while (*name == '/')
name++;
if (!*name)
return 0;
/* Extract the actual part from the pathname. */
next = grub_strchr (name, '/');
@ -484,6 +482,8 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
{
next[0] = '\0';
next++;
while (*next == '/')
next++;
}
do
@ -536,6 +536,8 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
{
next[0] = '\0';
next++;
while (*next == '/')
next++;
}
if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR)