Mercurial > cpython-lru_cache-weakref
diff Mac/Python/macgetpath.c @ 19841:d8dd75e3b304 legacy-trunk
Replaced PyMac_FullPath by PyMac_FullPathname, which has an extra 'length'
parameter for the return string (as unix pathnames are not limited
by the 255 char pstring limit).
Implemented the function for MachO-Python, where it returns unix pathnames.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Mon, 10 Sep 2001 22:00:39 +0000 |
| parents | dc17ef1a7613 |
| children | 274aa91b417c |
line wrap: on
line diff
--- a/Mac/Python/macgetpath.c Mon Sep 10 21:45:42 2001 +0000 +++ b/Mac/Python/macgetpath.c Mon Sep 10 22:00:39 2001 +0000 @@ -38,6 +38,11 @@ #include <unistd.h> #endif +#ifdef TARGET_API_MAC_OSX +#define PATHNAMELEN 1024 +#else +#define PATHNAMELEN 256 +#endif /* Return the initial python search path. This is called once from ** initsys() to initialize sys.path. @@ -244,7 +249,7 @@ PyMac_GetPythonDir() { static int diditbefore = 0; - static char name[256] = {':', '\0'}; + static char name[PATHNAMELEN] = {':', '\0'}; AliasHandle handle; FSSpec dirspec; Boolean modified = 0; @@ -285,7 +290,7 @@ if ( prefrh != -1 ) CloseResFile(prefrh); UseResFile(oldrh); - if ( PyMac_GetFullPath(&dirspec, name) == 0 ) { + if ( PyMac_GetFullPathname(&dirspec, name, PATHNAMELEN) == 0 ) { strcat(name, ":"); } else { /* If all fails, we return the current directory */
