From 0c6c324e90286cb9f23f0bcc948e91e5f7a220f1 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 17 May 2012 13:45:00 +0200 Subject: [PATCH] * grub-core/fs/fat.c (grub_fat_find_dir): Fix error message. New argument origpath. All users updated. --- ChangeLog | 5 +++++ grub-core/fs/fat.c | 12 +++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4220ff131..b25bcc0a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-17 Vladimir Serbinenko + + * grub-core/fs/fat.c (grub_fat_find_dir): Fix error message. + New argument origpath. All users updated. + 2012-05-15 Vladimir Serbinenko * grub-core/fs/ntfs.c (read_data): Prevent overflow. diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c index 5882096b0..e3052ee93 100644 --- a/grub-core/fs/fat.c +++ b/grub-core/fs/fat.c @@ -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. */ static char * 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, const struct grub_dirhook_info *info)) { char *dirname, *dirp; - char *origpath = NULL; int call_hook; int found = 0; @@ -877,10 +876,6 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, return 0; } - origpath = grub_strdup (path); - if (!origpath) - return 0; - /* Extract a directory name. */ while (*path == '/') path++; @@ -909,7 +904,6 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, fail: grub_free (dirname); - grub_free (origpath); return found ? dirp : 0; } @@ -945,7 +939,7 @@ grub_fat_dir (grub_device_t device, const char *path, 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); @@ -973,7 +967,7 @@ grub_fat_open (grub_file_t file, const char *name) 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) goto fail; } -- 2.39.5