+2012-06-22 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * util/getroot.c (grub_find_root_devices_from_mountinfo): Handle btrfs
+ subvolumes.
+
2012-06-22 Vladimir Serbinenko <phcoder@gmail.com>
Implement flow control for http.
{
ret = grub_find_root_devices_from_btrfs (dir);
if (relroot)
- *relroot = strdup (entries[i].enc_root);
+ {
+ char *ptr;
+ *relroot = xmalloc (strlen (entries[i].enc_root) +
+ 2 + strlen (dir));
+ ptr = stpcpy (*relroot, entries[i].enc_root);
+ if (strlen (dir) > strlen (entries[i].enc_path))
+ {
+ while (ptr > *relroot && *(ptr - 1) == '/')
+ ptr--;
+ if (dir[strlen (entries[i].enc_path)] != '/')
+ *ptr++ = '/';
+ ptr = stpcpy (ptr, dir + strlen (entries[i].enc_path));
+ }
+ *ptr = 0;
+ }
}
if (!ret)
{