summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-05-20 22:38:21 (GMT)
committerGuido van Rossum <guido@python.org>1997-05-20 22:38:21 (GMT)
commit7929c6fe957e1d2529e90a919505f91bee64e4fb (patch)
tree8a5777b380dc3f3b8fcf174c23f291b5be60fa4a /Modules
parentf9cba090f92e2fcd25e52c0ddffa030b83ca9bbf (diff)
downloadcpython-7929c6fe957e1d2529e90a919505f91bee64e4fb.zip
cpython-7929c6fe957e1d2529e90a919505f91bee64e4fb.tar.gz
cpython-7929c6fe957e1d2529e90a919505f91bee64e4fb.tar.bz2
Make delimiter and separator static for K&R C.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getpath.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 7632aeb..8330cbf 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -152,6 +152,7 @@ PERFORMANCE OF THIS SOFTWARE.
static char prefix[MAXPATHLEN+1];
static char exec_prefix[MAXPATHLEN+1];
+static char progpath[MAXPATHLEN+1];
static char *module_search_path = NULL;
static char lib_python[20]; /* Dynamically set to "lib/python" VERSION */
@@ -324,15 +325,14 @@ calculate_path()
{
extern char *Py_GetProgramName();
- char delimiter[2] = {DELIM, '\0'};
- char separator[2] = {SEP, '\0'};
+ static char delimiter[2] = {DELIM, '\0'};
+ static char separator[2] = {SEP, '\0'};
char *pythonpath = PYTHONPATH;
char *rtpypath = getenv("PYTHONPATH");
char *home = getenv("PYTHONHOME");
char *path = getenv("PATH");
char *prog = Py_GetProgramName();
char argv0_path[MAXPATHLEN+1];
- char progpath[MAXPATHLEN+1];
int pfound, efound; /* 1 if found; -1 if found build directory */
char *buf;
int bufsz;
@@ -543,3 +543,11 @@ Py_GetExecPrefix()
calculate_path();
return exec_prefix;
}
+
+char *
+Py_GetProgramFullPath()
+{
+ if (!module_search_path)
+ calculate_path();
+ return progpath;
+}