2008-09-05 Bean <bean123ch@gmail.com>
* fs/fshelp.c (grub_fshelp_find_file): Handle case insensitive names. * fs/ntfs.c (list_file): Ignore names in DOS namespace, set the case insensitive bit for names in Win32 and Win32 & DOS namespace. * include/grub/fshelp.h (GRUB_FSHELP_CASE_INSENSITIVE): New macro. * include/grub/types.h (LONG_MAX): Likewise.
This commit is contained in:
parent
4ee5592137
commit
5926115732
5 changed files with 34 additions and 6 deletions
18
fs/ntfs.c
18
fs/ntfs.c
|
@ -575,13 +575,20 @@ list_file (struct grub_ntfs_file *diro, char *pos,
|
|||
|
||||
while (1)
|
||||
{
|
||||
char *ustr;
|
||||
char *ustr, namespace;
|
||||
|
||||
if (pos[0xC] & 2) /* end signature */
|
||||
break;
|
||||
|
||||
np = pos + 0x52;
|
||||
ns = (unsigned char) *(np - 2);
|
||||
if (ns)
|
||||
np = pos + 0x50;
|
||||
ns = (unsigned char) *(np++);
|
||||
namespace = *(np++);
|
||||
|
||||
/*
|
||||
* Ignore files in DOS namespace, as they will reappear as Win32
|
||||
* names.
|
||||
*/
|
||||
if ((ns) && (namespace != 2))
|
||||
{
|
||||
enum grub_fshelp_filetype type;
|
||||
struct grub_ntfs_file *fdiro;
|
||||
|
@ -610,6 +617,9 @@ list_file (struct grub_ntfs_file *diro, char *pos,
|
|||
*grub_utf16_to_utf8 ((grub_uint8_t *) ustr, (grub_uint16_t *) np,
|
||||
ns) = '\0';
|
||||
|
||||
if (namespace)
|
||||
type |= GRUB_FSHELP_CASE_INSENSITIVE;
|
||||
|
||||
if (hook (ustr, type, fdiro))
|
||||
{
|
||||
grub_free (ustr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue