diff options
author | Guido van Rossum <guido@python.org> | 1995-01-21 13:46:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-01-21 13:46:04 (GMT) |
commit | 9aa3d1370eafa5f5a62eba73585ea6932b169821 (patch) | |
tree | 5ceeb49df67b5cd61574e082b5c97e4a9216fc55 /Mac/Python | |
parent | 796b259a1cc402711c530c996be94cef13c4e350 (diff) | |
download | cpython-9aa3d1370eafa5f5a62eba73585ea6932b169821.zip cpython-9aa3d1370eafa5f5a62eba73585ea6932b169821.tar.gz cpython-9aa3d1370eafa5f5a62eba73585ea6932b169821.tar.bz2 |
renamed Get routines to PyMac_Get; added macfs to config.c
Diffstat (limited to 'Mac/Python')
-rw-r--r-- | Mac/Python/macglue.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c index 741e985..7767515 100644 --- a/Mac/Python/macglue.c +++ b/Mac/Python/macglue.c @@ -31,6 +31,8 @@ Pstring(char *str) int len; len = strlen(str); + if (len > 255) + len = 255; buf[0] = (unsigned char)len; strncpy((char *)buf+1, str, len); return buf; @@ -147,20 +149,19 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs) if ( PyString_Check(v) ) { /* It's a pathname */ - if( !PyArg_Parse(v, "O&", GetStr255, &path) ) + if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) ) return 0; refnum = 0; /* XXXX Should get CurWD here... */ parid = 0; } else { - PyErr_Clear(); - if( !PyArg_Parse(v, "(hlO&); FSSpec should be fullpath or (int,int,string)", - &refnum, &parid, GetStr255, &path)) + if( !PyArg_Parse(v, "(hlO&); FSSpec should be fullpath or (vrefnum,dirid,path)", + &refnum, &parid, PyMac_GetStr255, &path)) { return 0; + } } err = FSMakeFSSpec(refnum, parid, path, fs); if ( err && err != fnfErr ) { - PyErr_SetString(PyExc_TypeError, - "FSMakeFSSpec error"); + PyErr_Mac(PyExc_ValueError, err); return 0; } return 1; |