bpo-38822: Check specifically for a drive, not just a colon (GH-25540)

(cherry picked from commit e07d809889)

Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
Miss Islington (bot) 2021-04-22 16:56:45 -07:00 committed by GitHub
parent ab5d78ce41
commit 28575923a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1808,8 +1808,8 @@ attributes_from_dir(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *re
while (--n > 0 && (filename[n] == L'\\' || filename[n] == L'/')) {
((LPWSTR)filename)[n] = L'\0';
}
if (!n || filename[n] == L':') {
// Nothing left te query
if (!n || (n == 1 && filename[1] == L':')) {
// Nothing left to query
free((void *)filename);
return FALSE;
}