]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1232023: Don't include empty path component from registry,
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 24 Jul 2006 11:54:53 +0000 (11:54 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 24 Jul 2006 11:54:53 +0000 (11:54 +0000)
so that the current directory does not get added to sys.path.
Also fixes #1526785.

Misc/NEWS
PC/getpathp.c

index 7a6e22d563d95b7bddd83901ce850cad891aba58..eee36c606d80e4166d0d08e540ff5c70b316f0f0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 2.5 release candidate 1?
 Core and builtins
 -----------------
 
+- Patch #1232023: Stop including current directory in search
+  path on Windows.
+
 - Fix some potential crashes found with failmalloc.
 
 - Fix warnings reported by Klocwork's static analysis tool.
index 2bd3f2653fda79ca4f64400e2d1ca66f34b19638..729d2e4736bbb26bc627a231c54cd716f4c391a9 100644 (file)
@@ -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) {