mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
fixed StandardGetFile argument handling
This commit is contained in:
parent
d56c109272
commit
b2f524ae44
1 changed files with 4 additions and 11 deletions
|
@ -405,27 +405,20 @@ mfs_StandardGetFile(self, args)
|
||||||
object *self; /* Not used */
|
object *self; /* Not used */
|
||||||
object *args;
|
object *args;
|
||||||
{
|
{
|
||||||
char *list[4];
|
SFTypeList list;
|
||||||
SFTypeList typelist;
|
|
||||||
short numtypes;
|
short numtypes;
|
||||||
StandardFileReply reply;
|
StandardFileReply reply;
|
||||||
|
|
||||||
list[0] = list[1] = list[2] = list[3] = 0;
|
list[0] = list[1] = list[2] = list[3] = 0;
|
||||||
numtypes = 0;
|
numtypes = 0;
|
||||||
#if 0
|
if (!newgetargs(args, "|O&O&O&O&", PyMac_GetOSType, &list[0],
|
||||||
/* XXXX Why doesn't this work? */
|
|
||||||
if (!newgetargs(args, "|O&|O&|O&|O&", PyMac_GetOSType, &list[0],
|
|
||||||
PyMac_GetOSType, &list[1], PyMac_GetOSType, &list[2],
|
PyMac_GetOSType, &list[1], PyMac_GetOSType, &list[2],
|
||||||
PyMac_GetOSType, &list[3]) )
|
PyMac_GetOSType, &list[3]) )
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
while ( numtypes < 4 && list[numtypes] ) {
|
||||||
if (!newgetargs(args, "|O&", PyMac_GetOSType, &list[0]) )
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
while ( list[numtypes] && numtypes < 4 ) {
|
|
||||||
numtypes++;
|
numtypes++;
|
||||||
}
|
}
|
||||||
StandardGetFile((FileFilterUPP)0, numtypes, typelist, &reply);
|
StandardGetFile((FileFilterUPP)0, numtypes, list, &reply);
|
||||||
return mkvalue("(Oi)", newmfssobject(&reply.sfFile), reply.sfGood);
|
return mkvalue("(Oi)", newmfssobject(&reply.sfFile), reply.sfGood);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue