ntdll: In find_file_in_dir(), don't test directory entries' short names if the target name isn't a short name.

hash_short_file_name() will always create a short name of at least 8 characters
with the 5th being a tilde (~).  If the target name isn't of that form, then it
can never match any short name constructed from the directory entries.
This commit is contained in:
Ken Thomases 2014-07-28 12:58:23 -05:00 committed by Alexandre Julliard
parent 1c23bf04c7
commit a14ed527d8
1 changed files with 3 additions and 0 deletions

View File

@ -2250,6 +2250,9 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
str.Length = length * sizeof(WCHAR);
str.MaximumLength = str.Length;
is_name_8_dot_3 = RtlIsNameLegalDOS8Dot3( &str, NULL, &spaces ) && !spaces;
#ifndef VFAT_IOCTL_READDIR_BOTH
is_name_8_dot_3 = is_name_8_dot_3 && length >= 8 && name[4] == '~';
#endif
if (!is_name_8_dot_3 && !get_dir_case_sensitivity( unix_name )) goto not_found;