Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-118507 : Refactornt._path_is*#118755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
ab76c061c5350dd7017ac2963338e833f04d0493c24403f4a7a9038fa6ec86d30603f0cd7c6d0168d299e00df4cb31a25259e140776acc0d2c8e464a8bc5f255b6b8061a62ceba79151515341301568bb07629c60fcffb5cae7a55cbf0bc44c0a3f75bf963e71cb7f024d27496edc3b3c6dae2c05dd20e2ced928dfd41967a7e94250b3612eab1cb46f6b07b0ca58a03f1ea76222c58a6e41cbfFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -5095,6 +5095,22 @@ os__path_splitroot_impl(PyObject *module, path_t *path) | ||
| #define PY_IFLRP 16 // Link Reparse Point (name-surrogate, symlink, junction) | ||
nineteendo marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| #define PY_IFRRP 32 // Regular Reparse Point | ||
| static inline BOOL | ||
| _testReparseTag(DWORD reparseTag, int testedType) | ||
nineteendo marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| { | ||
| switch (testedType) { | ||
| case PY_IFLNK: | ||
| return reparseTag == IO_REPARSE_TAG_SYMLINK; | ||
| case PY_IFMNT: | ||
| return reparseTag == IO_REPARSE_TAG_MOUNT_POINT; | ||
| case PY_IFLRP: | ||
| return IsReparseTagNameSurrogate(reparseTag); | ||
| case PY_IFRRP: | ||
| return reparseTag && !IsReparseTagNameSurrogate(reparseTag); | ||
| } | ||
| return FALSE | ||
nineteendo marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| } | ||
| static BOOL | ||
| _testFileTypeByHandle(HANDLE hfile, int testedType, BOOL diskOnly) | ||
| { | ||
| @@ -5133,16 +5149,7 @@ _testFileTypeByHandle(HANDLE hfile, int testedType, BOOL diskOnly) | ||
| } | ||
| if (attributes & FILE_ATTRIBUTE_REPARSE_POINT) { | ||
| return _testReparseTag(reparseTag, testedType); | ||
| } | ||
| else if (testedType == PY_IFREG) { | ||
| return ((fileDevType == FILE_TYPE_DISK) && | ||
| @@ -5167,26 +5174,18 @@ _testFileTypeByName(LPCWSTR path, int testedType) | ||
| sizeof(info))) | ||
| { | ||
| if (info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { | ||
| if (testedType == PY_IFREG) { | ||
| if (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) { | ||
| return FALSE; | ||
| } | ||
| } | ||
| else if (testedType ==PY_IFDIR) { | ||
| if (!(info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { | ||
| return FALSE; | ||
| } | ||
| } | ||
| else { | ||
| return _testReparseTag(info.ReparseTag, testedType); | ||
| } | ||
| } | ||
| else if (testedType == PY_IFREG) { | ||
| @@ -5229,22 +5228,8 @@ _testFileTypeByName(LPCWSTR path, int testedType) | ||
| if (testedType == PY_IFDIR) { | ||
| return !STAT(path, &st) && S_ISDIR(st.st_mode); | ||
| } | ||
| return (!LSTAT(path, &st) && | ||
| _testReparseTag(st.st_reparse_tag, testedType)) | ||
| } | ||
| return FALSE; | ||