Handle slash in HFS label.
* grub-core/fs/hfs.c (macroman_to_utf8): New argument slash_translate. (grub_hfs_dir): Tanslate slash. (grub_hfs_label): Don't translate slash.
This commit is contained in:
parent
54853fd72e
commit
9f3fc8835f
2 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2012-06-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
Handle slash in HFS label.
|
||||||
|
|
||||||
|
* grub-core/fs/hfs.c (macroman_to_utf8): New argument slash_translate.
|
||||||
|
(grub_hfs_dir): Tanslate slash.
|
||||||
|
(grub_hfs_label): Don't translate slash.
|
||||||
|
|
||||||
2012-06-26 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-06-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/commands/ls.c (grub_ls_list_devices): Disable
|
* grub-core/commands/ls.c (grub_ls_list_devices): Disable
|
||||||
|
|
|
@ -999,7 +999,8 @@ static const char macroman[0x80][MAX_UTF8_PER_MAC_ROMAN + 1] =
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
macroman_to_utf8 (char *to, const grub_uint8_t *from, grub_size_t len)
|
macroman_to_utf8 (char *to, const grub_uint8_t *from, grub_size_t len,
|
||||||
|
int translate_slash)
|
||||||
{
|
{
|
||||||
char *optr = to;
|
char *optr = to;
|
||||||
const grub_uint8_t *iptr;
|
const grub_uint8_t *iptr;
|
||||||
|
@ -1007,7 +1008,7 @@ macroman_to_utf8 (char *to, const grub_uint8_t *from, grub_size_t len)
|
||||||
for (iptr = from; iptr < from + len && *iptr; iptr++)
|
for (iptr = from; iptr < from + len && *iptr; iptr++)
|
||||||
{
|
{
|
||||||
/* Translate '/' to ':' as per HFS spec. */
|
/* Translate '/' to ':' as per HFS spec. */
|
||||||
if (*iptr == '/')
|
if (*iptr == '/' && translate_slash)
|
||||||
{
|
{
|
||||||
*optr++ = ':';
|
*optr++ = ':';
|
||||||
continue;
|
continue;
|
||||||
|
@ -1174,7 +1175,7 @@ grub_hfs_dir (grub_device_t device, const char *path,
|
||||||
len = ckey->strlen;
|
len = ckey->strlen;
|
||||||
if (len > sizeof (ckey->str))
|
if (len > sizeof (ckey->str))
|
||||||
len = sizeof (ckey->str);
|
len = sizeof (ckey->str);
|
||||||
macroman_to_utf8 (fname, ckey->str, len);
|
macroman_to_utf8 (fname, ckey->str, len, 1);
|
||||||
|
|
||||||
info.case_insensitive = 1;
|
info.case_insensitive = 1;
|
||||||
|
|
||||||
|
@ -1299,7 +1300,7 @@ grub_hfs_label (grub_device_t device, char **label)
|
||||||
*label = grub_malloc (len * MAX_UTF8_PER_MAC_ROMAN + 1);
|
*label = grub_malloc (len * MAX_UTF8_PER_MAC_ROMAN + 1);
|
||||||
if (*label)
|
if (*label)
|
||||||
macroman_to_utf8 (*label, data->sblock.volname + 1,
|
macroman_to_utf8 (*label, data->sblock.volname + 1,
|
||||||
len + 1);
|
len + 1, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*label = 0;
|
*label = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue