Applied changes from CVS version 1.28 of scheme.c in official version of

TinyScheme. Peter Michaux cleaned up port_rep_from_file.
This commit is contained in:
Kevin Cozens 2009-08-04 22:07:55 -04:00
parent 96d690d62f
commit 3d848b3917
1 changed files with 12 additions and 18 deletions

View File

@ -1416,24 +1416,18 @@ static pointer port_from_filename(scheme *sc, const char *fn, int prop) {
return mk_port(sc,pt);
}
static port *port_rep_from_file(scheme *sc, FILE *f, int prop) {
char *rw;
port *pt;
pt=(port*)sc->malloc(sizeof(port));
if(pt==0) {
return 0;
}
if(prop==(port_input|port_output)) {
rw="a+";
} else if(prop==port_output) {
rw="w";
} else {
rw="r";
}
pt->kind=port_file|prop;
pt->rep.stdio.file=f;
pt->rep.stdio.closeit=0;
return pt;
static port *port_rep_from_file(scheme *sc, FILE *f, int prop)
{
port *pt;
pt = (port *)sc->malloc(sizeof *pt);
if (pt == NULL) {
return NULL;
}
pt->kind = port_file | prop;
pt->rep.stdio.file = f;
pt->rep.stdio.closeit = 0;
return pt;
}
static pointer port_from_file(scheme *sc, FILE *f, int prop) {