* grub-core/fs/fat.c (grub_fat_iterate_dir_next): Don't stop on a space
character but still remove trainling spaces. (grub_fat_label): Ignore archive flag.
This commit is contained in:
parent
8645f72c72
commit
fb022c79ef
2 changed files with 29 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2012-06-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/fs/fat.c (grub_fat_iterate_dir_next): Don't stop on a space
|
||||||
|
character but still remove trainling spaces.
|
||||||
|
(grub_fat_label): Ignore archive flag.
|
||||||
|
|
||||||
2012-06-25 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-06-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/loader/i386/linux.c (grub_cmd_initrd): Avoid unnecessarry
|
* grub-core/loader/i386/linux.c (grub_cmd_initrd): Avoid unnecessarry
|
||||||
|
|
|
@ -798,22 +798,36 @@ grub_fat_iterate_dir_next (grub_disk_t disk, struct grub_fat_data *data,
|
||||||
filep = ctxt->filename;
|
filep = ctxt->filename;
|
||||||
if (ctxt->dir.attr & GRUB_FAT_ATTR_VOLUME_ID)
|
if (ctxt->dir.attr & GRUB_FAT_ATTR_VOLUME_ID)
|
||||||
{
|
{
|
||||||
for (i = 0; i < sizeof (ctxt->dir.name) && ctxt->dir.name[i]
|
for (i = 0; i < sizeof (ctxt->dir.name) && ctxt->dir.name[i]; i++)
|
||||||
&& ! grub_isspace (ctxt->dir.name[i]); i++)
|
|
||||||
*filep++ = ctxt->dir.name[i];
|
*filep++ = ctxt->dir.name[i];
|
||||||
|
while (i > 0 && ctxt->dir.name[i - 1] == ' ')
|
||||||
|
{
|
||||||
|
filep--;
|
||||||
|
i--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i = 0; i < 8 && ctxt->dir.name[i] && ! grub_isspace (ctxt->dir.name[i]); i++)
|
for (i = 0; i < 8 && ctxt->dir.name[i]; i++)
|
||||||
*filep++ = grub_tolower (ctxt->dir.name[i]);
|
*filep++ = grub_tolower (ctxt->dir.name[i]);
|
||||||
|
while (i > 0 && ctxt->dir.name[i - 1] == ' ')
|
||||||
|
{
|
||||||
|
filep--;
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
|
||||||
*filep = '.';
|
*filep++ = '.';
|
||||||
|
|
||||||
for (i = 8; i < 11 && ctxt->dir.name[i] && ! grub_isspace (ctxt->dir.name[i]); i++)
|
for (i = 8; i < 11 && ctxt->dir.name[i]; i++)
|
||||||
*++filep = grub_tolower (ctxt->dir.name[i]);
|
*filep++ = grub_tolower (ctxt->dir.name[i]);
|
||||||
|
while (i > 8 && ctxt->dir.name[i - 1] == ' ')
|
||||||
|
{
|
||||||
|
filep--;
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
|
||||||
if (*filep != '.')
|
if (i == 8)
|
||||||
filep++;
|
filep--;
|
||||||
}
|
}
|
||||||
*filep = '\0';
|
*filep = '\0';
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
@ -1117,7 +1131,7 @@ grub_fat_label (grub_device_t device, char **label)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
while (!(err = grub_fat_iterate_dir_next (disk, data, &ctxt)))
|
while (!(err = grub_fat_iterate_dir_next (disk, data, &ctxt)))
|
||||||
if (ctxt.dir.attr == GRUB_FAT_ATTR_VOLUME_ID)
|
if ((ctxt.dir.attr & ~GRUB_FAT_ATTR_ARCHIVE) == GRUB_FAT_ATTR_VOLUME_ID)
|
||||||
{
|
{
|
||||||
*label = grub_strdup (ctxt.filename);
|
*label = grub_strdup (ctxt.filename);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue