]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Don't strrchr
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 17 May 2012 11:47:23 +0000 (13:47 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 17 May 2012 11:47:23 +0000 (13:47 +0200)
through UTF-16.

ChangeLog
grub-core/fs/iso9660.c

index b25bcc0a750148b884379acaeced71a875505e24..f1eb652d56adfa3f3ab21d2d2c92310dc713aba3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-17  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Don't strrchr
+       through UTF-16.
+
 2012-05-17  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/fat.c (grub_fat_find_dir): Fix error message.
index 992de35b68628c03b9318637d22014d7166dbce6..318d07edb0f36e74195bc172bd7aa65e4d3e1b60 100644 (file)
@@ -725,30 +725,29 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
              type = GRUB_FSHELP_REG;
          }
 
+       /* . and .. */
+       if (!filename && dirent.namelen == 1 && (name[0] == ';' || name[0] == 0 || name[0] == 1))
+         {
+           grub_free (node);
+           continue;
+         }
+
        /* The filename was not stored in a rock ridge entry.  Read it
           from the iso9660 filesystem.  */
-       if (!filename)
+       if (!dir->data->joliet && !filename)
          {
            name[dirent.namelen] = '\0';
            filename = grub_strrchr (name, ';');
            if (filename)
              *filename = '\0';
-
-           /* . and .. */
-           if (dirent.namelen == 1 && (name[0] == 0 || name[0] == 1))
-             {
-               grub_free (node);
-               continue;
-             }
-           else
-             filename = name;
+           filename = name;
          }
 
-        if (dir->data->joliet)
+        if (dir->data->joliet && !filename)
           {
             char *oldname, *semicolon;
 
-            oldname = filename;
+            oldname = name;
             filename = grub_iso9660_convert_string
                   ((grub_uint8_t *) oldname, dirent.namelen >> 1);