* grub-core/fs/sfs.c (grub_sfs_read_symlink): Convert latin1 into

UTF-8.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-05-07 21:57:51 +02:00
parent 2f48221f5c
commit 7dceec9b69
2 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2012-05-07 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/sfs.c (grub_sfs_read_symlink): Convert latin1 into
UTF-8.
2012-05-07 Vladimir Serbinenko <phcoder@gmail.com> 2012-05-07 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/affs.c (grub_affs_iterate_dir): Mark as case insensitive. * grub-core/fs/affs.c (grub_affs_iterate_dir): Mark as case insensitive.

View file

@ -447,12 +447,16 @@ grub_sfs_read_symlink (grub_fshelp_node_t node)
/* This is just a wild guess, but it always worked for me. How the /* This is just a wild guess, but it always worked for me. How the
SLNK block looks like is not documented in the SFS docs. */ SLNK block looks like is not documented in the SFS docs. */
symlink = grub_strndup (&block[24], symlink = grub_malloc (((GRUB_DISK_SECTOR_SIZE << data->log_blocksize)
(GRUB_DISK_SECTOR_SIZE << data->log_blocksize) - 24); - 24) * GRUB_MAX_UTF8_PER_LATIN1 + 1);
grub_free (block);
if (!symlink) if (!symlink)
{
grub_free (block);
return 0; return 0;
}
*grub_latin1_to_utf8 ((grub_uint8_t *) symlink, (grub_uint8_t *) &block[24],
(GRUB_DISK_SECTOR_SIZE << data->log_blocksize) - 24) = '\0';
grub_free (block);
return symlink; return symlink;
} }