* grub-core/fs/jfs.c (grub_jfs_label): Use first label if second one

starts with control character.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-03-19 11:07:28 +01:00
parent 0382d9bb22
commit d2d58d0ab4
2 changed files with 15 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2012-03-19 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/jfs.c (grub_jfs_label): Use first label if second one
starts with control character.
2012-03-19 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/gdb/cstub.c (grub_gdb_inbuf): Increase the size to avoid

View file

@ -888,12 +888,18 @@ grub_jfs_label (grub_device_t device, char **label)
if (data)
{
if (data->sblock.volname2[0])
if (data->sblock.volname2[0] < ' ')
{
char *ptr;
ptr = data->sblock.volname + sizeof (data->sblock.volname) - 1;
while (ptr >= data->sblock.volname && *ptr == ' ')
ptr--;
*label = grub_strndup (data->sblock.volname,
ptr - data->sblock.volname + 1);
}
else
*label = grub_strndup (data->sblock.volname2,
sizeof (data->sblock.volname2));
else
*label = grub_strndup (data->sblock.volname,
sizeof (data->sblock.volname));
}
else
*label = 0;