summaryrefslogtreecommitdiff
path: root/PC
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-07-24 11:54:53 +0000
committerMartin v. Löwis <martin@v.loewis.de>2006-07-24 11:54:53 +0000
commitfe77b63877c28d6dc167ee6e6ea4d66e465ff0b1 (patch)
tree90e5fc36f1972bb4a1dcb20771eb6d9757064c36 /PC
parent342e2a823ff20523bef273469765fd99977cf70c (diff)
downloadcpython-fe77b63877c28d6dc167ee6e6ea4d66e465ff0b1.tar.gz
Patch #1232023: Don't include empty path component from registry,
so that the current directory does not get added to sys.path. Also fixes #1526785.
Diffstat (limited to 'PC')
-rw-r--r--PC/getpathp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 2bd3f2653f..729d2e4736 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -297,6 +297,10 @@ getpythonregpath(HKEY keyBase, int skipcore)
}
RegCloseKey(subKey);
}
+
+ /* return null if no path to return */
+ if (dataSize == 0) goto done;
+
/* original datasize from RegQueryInfo doesn't include the \0 */
dataBuf = malloc((dataSize+1) * sizeof(TCHAR));
if (dataBuf) {