Module: wine
Branch: master
Commit: a14ed527d858e22cc754a5513eabf7c250eec7a0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a14ed527d858e22cc754a5513…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Mon Jul 28 12:58:23 2014 -0500
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.
---
dlls/ntdll/directory.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 04a5b75..a2796b2 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -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;