* fs/cpio.c (grub_cpio_open): Compare `name' and `fn' by hand in
order to cope with duplicate slashes.
+2008-11-14 Robert Millan <rmh@aybabtu.com>
+
+ * fs/cpio.c (grub_cpio_open): Compare `name' and `fn' by hand in
+ order to cope with duplicate slashes.
+
2008-11-14 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/coreboot/memory.h (GRUB_MEMORY_MACHINE_LOWER_SIZE):
struct grub_cpio_data *data;
grub_uint32_t ofs;
char *fn;
+ int i, j;
#ifndef GRUB_UTIL
grub_dl_ref (my_mod);
break;
}
- if (grub_strcmp (name + 1, fn) == 0)
+ /* Compare NAME and FN by hand in order to cope with duplicate
+ slashes. */
+ i = 1;
+ j = 0;
+ while (1)
{
- file->data = data;
- file->size = data->size;
- grub_free (fn);
-
- return GRUB_ERR_NONE;
+ if (name[i] != fn[j])
+ goto no_match;
+
+ if (name[i] == '\0')
+ break;
+
+ if (name[i] == '/' && name[i+1] == '/')
+ i++;
+
+ i++;
+ j++;
}
+ file->data = data;
+ file->size = data->size;
+ grub_free (fn);
+
+ return GRUB_ERR_NONE;
+
+ no_match:
+
grub_free (fn);
data->hofs = ofs;
}