summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-08-11 20:35:56 (GMT)
committerGuido van Rossum <guido@python.org>1998-08-11 20:35:56 (GMT)
commit24edfbb61d7306e671b75ecbfb9465f81ddb8818 (patch)
tree75647332709a6c14552a0e594e1aa1e936e741e2 /PC
parentd10552379dd85f432545ba3c9199d2b232593f30 (diff)
downloadcpython-24edfbb61d7306e671b75ecbfb9465f81ddb8818.zip
cpython-24edfbb61d7306e671b75ecbfb9465f81ddb8818.tar.gz
cpython-24edfbb61d7306e671b75ecbfb9465f81ddb8818.tar.bz2
Back out of a recent policy change (Mark Hammond disagreed).
The registry always comes first and the default is always appended.
Diffstat (limited to 'PC')
-rw-r--r--PC/getpathp.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 2aaa4f3..80865d7 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -164,17 +164,6 @@ search_for_prefix(argv0_path, landmark)
#define BUILD_LANDMARK "PC\\getpathp.c"
#endif
-static int
-prefixisbuilddir()
-{
- int n = strlen(prefix);
- int ok;
- join(prefix, BUILD_LANDMARK);
- ok = exists(prefix);
- prefix[n] = '\0';
- return ok;
-}
-
#include "malloc.h" // for alloca - see comments below!
extern const char *PyWin_DLLVersionString; // a string loaded from the DLL at startup.
@@ -364,16 +353,14 @@ calculate_path()
envpath = NULL;
#ifdef MS_WIN32
- if (!prefixisbuilddir()) {
- /* Are we running under Windows 3.1(1) Win32s? */
- if (PyWin_IsWin32s()) {
- /* Only CLASSES_ROOT is supported */
- machinepath = getpythonregpath(HKEY_CLASSES_ROOT, TRUE);
- userpath = NULL;
- } else {
- machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, FALSE);
- userpath = getpythonregpath(HKEY_CURRENT_USER, FALSE);
- }
+ /* Are we running under Windows 3.1(1) Win32s? */
+ if (PyWin_IsWin32s()) {
+ /* Only CLASSES_ROOT is supported */
+ machinepath = getpythonregpath(HKEY_CLASSES_ROOT, TRUE);
+ userpath = NULL;
+ } else {
+ machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, FALSE);
+ userpath = getpythonregpath(HKEY_CURRENT_USER, FALSE);
}
#endif
@@ -404,8 +391,6 @@ calculate_path()
bufsz += strlen(PYTHONPATH) + 1;
bufsz += strlen(argv0_path) + 1;
#ifdef MS_WIN32
- if (userpath || machinepath)
- bufsz = 0; /* Reset! */
if (userpath)
bufsz += strlen(userpath) + 1;
if (machinepath)
@@ -453,10 +438,6 @@ calculate_path()
*buf++ = DELIM;
free(machinepath);
}
- if (userpath || machinepath) {
- buf[-1] = '\0';
- return;
- }
#endif
if (pythonhome == NULL) {
strcpy(buf, PYTHONPATH);