Skip to content

Commit 9f0b3a9

Browse files
bpo-38822: Check specifically for a drive, not just a colon (GH-25540)
(cherry picked from commit e07d809) Co-authored-by: Steve Dower <[email protected]>
1 parent 1575ea0 commit 9f0b3a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,8 @@ attributes_from_dir(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *re
16601660
while (--n > 0 && (filename[n] == L'\\' || filename[n] == L'/')) {
16611661
((LPWSTR)filename)[n] = L'\0';
16621662
}
1663-
if (!n || filename[n] == L':') {
1664-
// Nothing left te query
1663+
if (!n || (n == 1 && filename[1] == L':')) {
1664+
// Nothing left to query
16651665
free((void *)filename);
16661666
return FALSE;
16671667
}

0 commit comments

Comments
 (0)