[PATCH 2/2] ntdll: Check for case-insensitive volumes.

Alexandre Julliard julliard at winehq.org
Mon Oct 18 09:28:15 CDT 2010


Charles Davis <cdavis at mymail.mines.edu> writes:

> @@ -1828,13 +2054,24 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
>      if (ret >= 0 && !used_default)
>      {
>          unix_name[pos + ret] = 0;
> -        if (!stat( unix_name, &st ))
> +        /* when checking case on a case insensitive but case preserving
> +         * fs, don't even bother doing the stat(), so we don't match the 
> +         * file case-insensitively.
> +         */
> +        if ((case_sensitive || !check_case) && !stat( unix_name, &st ))
>          {
>              if (is_win_dir) *is_win_dir = is_same_file( &windir, &st );
>              return STATUS_SUCCESS;
>          }

This still doesn't make sense. There's no reason to ever skip the stat.

> @@ -2455,6 +2713,10 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
>          const WCHAR *end, *next;
>          int is_win_dir = 0;
>  
> +        unix_name[pos] = 0;
> +        stat( unix_name, &st );
> +        unix_name[pos] = '/';

You can't add extra stat calls to the normal path. This is supposed to
be an optimization.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list