Skip to content

Commit 2857592

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 ab5d78c commit 2857592

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
@@ -1808,8 +1808,8 @@ attributes_from_dir(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *re
18081808
while (--n > 0 && (filename[n] == L'\\' || filename[n] == L'/')) {
18091809
((LPWSTR)filename)[n] = L'\0';
18101810
}
1811-
if (!n || filename[n] == L':') {
1812-
// Nothing left te query
1811+
if (!n || (n == 1 && filename[1] == L':')) {
1812+
// Nothing left to query
18131813
free((void *)filename);
18141814
return FALSE;
18151815
}

0 commit comments

Comments
 (0)