Commit a14ed527 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

ntdll: In find_file_in_dir(), don't test directory entries' short names if the…

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.
parent 1c23bf04
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment