summaryrefslogtreecommitdiffstats
path: root/PC/getpathp.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2021-11-05 23:06:45 (GMT)
committerGitHub <noreply@github.com>2021-11-05 23:06:45 (GMT)
commita4774f42e35861c4bb16928cffb011c2d8a285ac (patch)
tree7f996828acfbced9695297ee6b957b2ede44bdf1 /PC/getpathp.c
parent4d8f2e09b6216449f7b10eb42fd9af0d32f99be3 (diff)
downloadcpython-a4774f42e35861c4bb16928cffb011c2d8a285ac.zip
cpython-a4774f42e35861c4bb16928cffb011c2d8a285ac.tar.gz
cpython-a4774f42e35861c4bb16928cffb011c2d8a285ac.tar.bz2
bpo-45720: Drop references to shlwapi.dll on Windows (GH-29417)
Diffstat (limited to 'PC/getpathp.c')
-rw-r--r--PC/getpathp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 549353d..a273480 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -92,7 +92,6 @@
#include <windows.h>
#include <pathcch.h>
-#include <shlwapi.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -265,7 +264,8 @@ canonicalize(wchar_t *buffer, const wchar_t *path)
return _PyStatus_NO_MEMORY();
}
- if (PathIsRelativeW(path)) {
+ const wchar_t *pathTail;
+ if (FAILED(PathCchSkipRoot(path, &pathTail)) || path == pathTail) {
wchar_t buff[MAXPATHLEN + 1];
if (!GetCurrentDirectoryW(MAXPATHLEN, buff)) {
return _PyStatus_ERR("unable to find current working directory");