grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Case insensitive filename for NTFS


From: Robert Millan
Subject: Re: [PATCH] Case insensitive filename for NTFS
Date: Sat, 30 Aug 2008 14:47:13 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Sat, Aug 30, 2008 at 03:07:21AM +0800, Bean wrote:
> Hi,
> 
> This patch allow case insensitive filename in Win32 and DOS namespace.
> Names in POSIX namespace would still be case sensitive. It also remove
> names in the DOS namespace, as they will reappear in Win32 namespace.

Nice work :-)

> --- a/fs/fshelp.c
> +++ b/fs/fshelp.c
> @@ -80,7 +80,13 @@ grub_fshelp_find_file (const char *path, 
> grub_fshelp_node_t rootnode,
>                                   enum grub_fshelp_filetype filetype,
>                                   grub_fshelp_node_t node)
>       {
> -       if (type == GRUB_FSHELP_UNKNOWN || grub_strcmp (name, filename))
> +          int case_insensitive = (filetype & GRUB_FSHELP_CASE_INSENSITIVE);
> +
> +          filetype &= ~GRUB_FSHELP_CASE_INSENSITIVE;
> +       if (filetype == GRUB_FSHELP_UNKNOWN ||
> +              (grub_strcmp (name, filename) &&
> +               (! case_insensitive ||
> +                grub_strncasecmp (name, filename, LONG_MAX))))

Since `case_insensitive' is only used once, maybe we could skip this
variable?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]