Kaydet (Commit) 1d2f863e authored tarafından Jack Jansen's avatar Jack Jansen

Guido's 1.4b2 fixes: Py_GetProgramName, Py_GetPrefix and Py_GetExecPrefix.

üst d84e7aaf
...@@ -58,10 +58,10 @@ extern char *Py_GetVersion Py_PROTO((void)); ...@@ -58,10 +58,10 @@ extern char *Py_GetVersion Py_PROTO((void));
extern char *Py_GetCopyright Py_PROTO((void)); extern char *Py_GetCopyright Py_PROTO((void));
/* For getprogramname(); set by main() */ /* For Py_GetProgramName(); set by main() */
static char *argv0; static char *argv0;
/* For getargcargv(); set by main() */ /* For Py_GetArgcArgv(); set by main() */
static char **orig_argv; static char **orig_argv;
static int orig_argc; static int orig_argc;
...@@ -316,9 +316,9 @@ Py_Main(argc, argv) ...@@ -316,9 +316,9 @@ Py_Main(argc, argv)
PyMac_InteractiveOptions(&inspect, &Py_VerboseFlag, &Py_SuppressPrintingFlag, PyMac_InteractiveOptions(&inspect, &Py_VerboseFlag, &Py_SuppressPrintingFlag,
&unbuffered, &Py_DebugFlag, &keep_normal, &keep_error, &argc, &argv); &unbuffered, &Py_DebugFlag, &keep_normal, &keep_error, &argc, &argv);
orig_argc = argc; /* For getargcargv() */ orig_argc = argc; /* For Py_GetArgcArgv() */
orig_argv = argv; orig_argv = argv;
argv0 = argv[0]; /* For getprogramname() */ argv0 = argv[0]; /* For Py_GetProgramName() */
if (unbuffered) { if (unbuffered) {
#ifndef MPW #ifndef MPW
...@@ -403,7 +403,7 @@ PyMac_Exit(status) ...@@ -403,7 +403,7 @@ PyMac_Exit(status)
/* Return the program name -- some code out there needs this. */ /* Return the program name -- some code out there needs this. */
char * char *
getprogramname() Py_GetProgramName()
{ {
return argv0; return argv0;
} }
...@@ -413,10 +413,24 @@ getprogramname() ...@@ -413,10 +413,24 @@ getprogramname()
This is rare, but it is needed by the secureware extension. */ This is rare, but it is needed by the secureware extension. */
void void
getargcargv(argc,argv) Py_GetArgcArgv(argc,argv)
int *argc; int *argc;
char ***argv; char ***argv;
{ {
*argc = orig_argc; *argc = orig_argc;
*argv = orig_argv; *argv = orig_argv;
} }
/* More cruft that shouldn't really be here, used in sysmodule.c */
char *
Py_GetPrefix()
{
return "";
}
char *
Py_GetExecPrefix()
{
return "";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment