Fix problem reported by Donn Cave: if VPATH is an absolute path, it

would always be a hit.   Prevent this by only using VPATH if we know
we are in the build directory.
This commit is contained in:
Guido van Rossum 1997-05-12 20:49:39 +00:00
parent 4a807f5939
commit 573a24a4f7

View file

@ -209,6 +209,10 @@ search_for_prefix(argv0_path, home)
int i, n;
char *vpath;
/* Check to see if argv[0] is in the build directory */
strcpy(prefix, argv0_path);
join(prefix, "Modules/Setup");
if (exists(prefix)) {
/* Check VPATH to see if argv0_path is in the build directory.
* Complication: the VPATH passed in is relative to the
* Modules build directory and points to the Modules source
@ -228,6 +232,7 @@ search_for_prefix(argv0_path, home)
join(prefix, LANDMARK);
if (exists(prefix))
return -1;
}
if (home) {
/* Check $PYTHONHOME */
@ -474,6 +479,8 @@ calculate_path()
strcpy(buf, rtpypath);
strcat(buf, delimiter);
}
else
buf[0] = '\0';
/* Next goes merge of compile-time $PYTHONPATH with
* dynamically located prefix.