projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69774c2
)
Patch #931938: prevent setting sys.prefix to ""
author
Georg Brandl
<georg@python.org>
Mon, 20 Feb 2006 17:37:36 +0000
(17:37 +0000)
committer
Georg Brandl
<georg@python.org>
Mon, 20 Feb 2006 17:37:36 +0000
(17:37 +0000)
Modules/getpath.c
patch
|
blob
|
history
diff --git
a/Modules/getpath.c
b/Modules/getpath.c
index 3264e246a41af6bed459fb52d3a6c61834657df1..4716d154587e6dac1cb3d3ac40ddcb44de7498ce 100644
(file)
--- a/
Modules/getpath.c
+++ b/
Modules/getpath.c
@@
-628,6
+628,10
@@
calculate_path(void)
if (pfound > 0) {
reduce(prefix);
reduce(prefix);
+ /* The prefix is the root directory, but reduce() chopped
+ * off the "/". */
+ if (!prefix[0])
+ strcpy(prefix, separator);
}
else
strncpy(prefix, PREFIX, MAXPATHLEN);
@@
-636,6
+640,8
@@
calculate_path(void)
reduce(exec_prefix);
reduce(exec_prefix);
reduce(exec_prefix);
+ if (!exec_prefix[0])
+ strcpy(exec_prefix, separator);
}
else
strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);