mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
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.
This commit is contained in:
parent
b0e8e9b72f
commit
697842f58c
6 changed files with 74 additions and 35 deletions
|
@ -38,6 +38,11 @@ PERFORMANCE OF THIS SOFTWARE.
|
|||
#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 @@ char *
|
|||
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 @@ PyMac_GetPythonDir()
|
|||
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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue