]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Fix symlink
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 10 May 2012 21:35:03 +0000 (23:35 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 10 May 2012 21:35:03 +0000 (23:35 +0200)
handling.

ChangeLog
grub-core/fs/iso9660.c

index aee8654db58089b361074de731dc8ac293c2b638..5e9d1a424ee9ba6a520bf6ab67a9696fca850f08 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Fix symlink
+       handling.
+
 2012-05-10  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/ufs.c (grub_ufs_find_file): Fix handling of double slash.
index 394fe44868d806fa781ab2d1472cae3b0b4413f8..992de35b68628c03b9318637d22014d7166dbce6 100644 (file)
@@ -533,6 +533,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
   enum grub_fshelp_filetype type;
   grub_off_t len;
   char *symlink = 0;
+  int was_continue = 0;
 
   /* Extend the symlink.  */
   auto inline void  __attribute__ ((always_inline)) add_part (const char *part,
@@ -630,11 +631,11 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
                    /* The data on pos + 2 is the actual data, pos + 1
                       is the length.  Both are part of the `Component
                       Record'.  */
-                   if (symlink && (entry->data[pos] & 1))
+                   if (symlink && !was_continue)
                      add_part ("/", 1);
                    add_part ((char *) &entry->data[pos + 2],
                              entry->data[pos + 1]);
-
+                   was_continue = (entry->data[pos] & 1);
                    break;
                  }
 
@@ -668,6 +669,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
   for (; offset < len; offset += dirent.len)
     {
       symlink = 0;
+      was_continue = 0;
 
       if (read_node (dir, offset, sizeof (dirent), (char *) &dirent))
        return 0;
@@ -817,6 +819,8 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
                         + node->have_dirents * sizeof (node->dirents[0])
                         - sizeof (node->dirents), symlink);
            grub_free (symlink);
+           symlink = 0;
+           was_continue = 0;
          }
        if (hook (filename, type, node))
          {