summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/fileobject.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index f87e22e..7da32a9 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -61,9 +61,17 @@ newfileobject(name, mode)
f = (fileobject *) newopenfileobject((FILE *)NULL, name, mode);
if (f == NULL)
return NULL;
- if ((f->f_fp = fopen(name, mode)) == NULL) {
+#ifdef THINK_C
+ if (*mode == '*') {
+ FILE *fopenRF();
+ f->f_fp = fopenRF(name, mode+1);
+ }
+ else
+#endif
+ f->f_fp = fopen(name, mode);
+ if (f->f_fp == NULL) {
+ err_errno(RuntimeError);
DECREF(f);
- err_errno(RuntimeError); /* XXX Should use another error */
return NULL;
}
return (object *)f;