summaryrefslogtreecommitdiffstats
path: root/Mac/Python/macgetpath.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-09-10 22:00:39 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-09-10 22:00:39 (GMT)
commit697842f58cfa15e86e92fa1c2733d7d9908a340e (patch)
tree7f5045964d5946de3f348459fb485a2463eddb69 /Mac/Python/macgetpath.c
parentb0e8e9b72fb6eb42ecd4d9ea9e88563d1ca4528a (diff)
downloadcpython-697842f58cfa15e86e92fa1c2733d7d9908a340e.zip
cpython-697842f58cfa15e86e92fa1c2733d7d9908a340e.tar.gz
cpython-697842f58cfa15e86e92fa1c2733d7d9908a340e.tar.bz2
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.
Diffstat (limited to 'Mac/Python/macgetpath.c')
-rw-r--r--Mac/Python/macgetpath.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Mac/Python/macgetpath.c b/Mac/Python/macgetpath.c
index 83117ed..e087023 100644
--- a/Mac/Python/macgetpath.c
+++ b/Mac/Python/macgetpath.c
@@ -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 */