* grub-core/fs/fat.c (grub_fat_find_dir): Fix error message.
New argument origpath. All users updated.
This commit is contained in:
parent
c6666ba687
commit
0c6c324e90
2 changed files with 8 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2012-05-17 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/fs/fat.c (grub_fat_find_dir): Fix error message.
|
||||||
|
New argument origpath. All users updated.
|
||||||
|
|
||||||
2012-05-15 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-05-15 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/ntfs.c (read_data): Prevent overflow.
|
* grub-core/fs/ntfs.c (read_data): Prevent overflow.
|
||||||
|
|
|
@ -821,12 +821,11 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
|
||||||
If HOOK is specified, call it with each file name. */
|
If HOOK is specified, call it with each file name. */
|
||||||
static char *
|
static char *
|
||||||
grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
|
grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
|
||||||
const char *path,
|
const char *path, const char *origpath,
|
||||||
int (*hook) (const char *filename,
|
int (*hook) (const char *filename,
|
||||||
const struct grub_dirhook_info *info))
|
const struct grub_dirhook_info *info))
|
||||||
{
|
{
|
||||||
char *dirname, *dirp;
|
char *dirname, *dirp;
|
||||||
char *origpath = NULL;
|
|
||||||
int call_hook;
|
int call_hook;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
|
@ -877,10 +876,6 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
origpath = grub_strdup (path);
|
|
||||||
if (!origpath)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* Extract a directory name. */
|
/* Extract a directory name. */
|
||||||
while (*path == '/')
|
while (*path == '/')
|
||||||
path++;
|
path++;
|
||||||
|
@ -909,7 +904,6 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data,
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
grub_free (dirname);
|
grub_free (dirname);
|
||||||
grub_free (origpath);
|
|
||||||
|
|
||||||
return found ? dirp : 0;
|
return found ? dirp : 0;
|
||||||
}
|
}
|
||||||
|
@ -945,7 +939,7 @@ grub_fat_dir (grub_device_t device, const char *path,
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
p = grub_fat_find_dir (disk, data, p, hook);
|
p = grub_fat_find_dir (disk, data, p, path, hook);
|
||||||
}
|
}
|
||||||
while (p && grub_errno == GRUB_ERR_NONE);
|
while (p && grub_errno == GRUB_ERR_NONE);
|
||||||
|
|
||||||
|
@ -973,7 +967,7 @@ grub_fat_open (grub_file_t file, const char *name)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
p = grub_fat_find_dir (file->device->disk, data, p, 0);
|
p = grub_fat_find_dir (file->device->disk, data, p, name, 0);
|
||||||
if (grub_errno != GRUB_ERR_NONE)
|
if (grub_errno != GRUB_ERR_NONE)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue