]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/fat.c (grub_fat_find_dir): Fix error message.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 17 May 2012 11:45:00 +0000 (13:45 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 17 May 2012 11:45:00 +0000 (13:45 +0200)
New argument origpath. All users updated.

ChangeLog
grub-core/fs/fat.c

index 4220ff1310651f3b06c51953d7cce0d990da4308..b25bcc0a750148b884379acaeced71a875505e24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * grub-core/fs/ntfs.c (read_data): Prevent overflow.
index 5882096b03ad48e08d9bfa488f0f6e2d269334e6..e3052ee9319e0ae87ab1a0cfd4e7fbf2c9b5060b 100644 (file)
@@ -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;
     }