Commits

Jack Jansen  committed 515e1d0

Use PyMac_GetPythonDir() to obtain python homedir
fileargument moved here from macmain.c

  • Participants
  • Parent commits ff72a5f
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Mac/Modules/config.c

 #ifdef macintosh
 /* The Macintosh main program is in macmain.c */
 #define NO_MAIN
+char *fileargument;		/* So main() can tell us the program name */
 #endif
 
 #include <stdio.h>
 #include "osdefs.h"
 #include "intrcheck.h"
 
+char *PyMac_GetPythonDir();
 
 #ifndef NO_MAIN
 
 	** - Chdir to where the source file (if any) lives
 	*/
 	static char *pythonpath;
-	extern char *fileargument;
-	char curwd[256];
+	char *curwd;
 	char *p, *endp;
 	int newlen;
 	
 	if ( pythonpath ) return pythonpath;
-	if (getwd(curwd) < 0 ) {
-		return PYTHONPATH;
-	}
+	curwd = PyMac_GetPythonDir();
 	p = PYTHONPATH;
 	endp = p;
 	pythonpath = malloc(2);