diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-07-24 11:54:53 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-07-24 11:54:53 +0000 |
commit | d22968af17f64ed5883f9cccfed0f0337dc3bc19 (patch) | |
tree | 110d2d41c31915a7a1b1237c87e1ee05cc661c4a /PC/getpathp.c | |
parent | bda0dde1c46c7f86c09f1b54d0b14125e9ab7f52 (diff) | |
download | cpython-git-d22968af17f64ed5883f9cccfed0f0337dc3bc19.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/getpathp.c')
-rw-r--r-- | PC/getpathp.c | 4 |
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) { |