]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix extent overflow comparator.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 26 May 2012 09:54:20 +0000 (11:54 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 26 May 2012 09:54:20 +0000 (11:54 +0200)
* grub-core/fs/hfsplus.c (grub_hfsplus_extkey_internal): Add type.
(grub_hfsplus_read_block): Set type.
(grub_hfsplus_cmp_extkey): Compare type.

ChangeLog
grub-core/fs/hfsplus.c

index c55fa79c5e73c7888e1fb481acb995d17afc958c..adf4ebd95e5bb8bf0b5c1d34dfc99997c1af76f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-05-25  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Fix extent overflow comparator.
+
+       * grub-core/fs/hfsplus.c (grub_hfsplus_extkey_internal): Add type.
+       (grub_hfsplus_read_block): Set type.
+       (grub_hfsplus_cmp_extkey): Compare type.
+
 2012-05-25  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub-fstest.c (cmd_cmp): Fix stat'ing of wrong file.
index a84b60e09f1be680922408b4d145150061f2c31e..42b2c01f1d6a3f49a21faaa958b1ce60b5da24cd 100644 (file)
@@ -189,6 +189,7 @@ struct grub_hfsplus_catkey_internal
 struct grub_hfsplus_extkey_internal
 {
   grub_uint32_t fileid;
+  grub_uint8_t type;
   grub_uint32_t start;
 };
 
@@ -341,6 +342,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
 
       /* Set up the key to look for in the extent overflow file.  */
       extoverflow.extkey.fileid = node->fileid;
+      extoverflow.extkey.type = 0;
       extoverflow.extkey.start = fileblock - blksleft;
 
       if (grub_hfsplus_btree_search (&node->data->extoverflow_tree,
@@ -579,6 +581,11 @@ grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya,
     return 1;
   if (akey < extkey_b->fileid)
     return -1;
+
+  if (extkey_a->type > extkey_b->type)
+    return 1;
+  if (extkey_a->type < extkey_b->type)
+    return -1;
   
   akey = grub_be_to_cpu32 (extkey_a->start);
   if (akey > extkey_b->start)