[Python-checkins] r42523 - python/branches/release24-maint/Modules/getpath.c

georg.brandl python-checkins at python.org
Mon Feb 20 18:37:39 CET 2006


Author: georg.brandl
Date: Mon Feb 20 18:37:39 2006
New Revision: 42523
Modified:
 python/branches/release24-maint/Modules/getpath.c
Log:
Patch #931938: prevent setting sys.prefix to ""
Modified: python/branches/release24-maint/Modules/getpath.c
==============================================================================
--- python/branches/release24-maint/Modules/getpath.c	(original)
+++ python/branches/release24-maint/Modules/getpath.c	Mon Feb 20 18:37:39 2006
@@ -628,6 +628,10 @@
 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 @@
 reduce(exec_prefix);
 reduce(exec_prefix);
 reduce(exec_prefix);
+	if (!exec_prefix[0])
+		strcpy(exec_prefix, separator);
 }
 else
 strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /