mirror of https://github.com/GNOME/gimp.git
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:
parent
96d690d62f
commit
3d848b3917
|
@ -1416,19 +1416,13 @@ 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;
|
||||
static port *port_rep_from_file(scheme *sc, FILE *f, int prop)
|
||||
{
|
||||
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 = (port *)sc->malloc(sizeof *pt);
|
||||
if (pt == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
pt->kind = port_file | prop;
|
||||
pt->rep.stdio.file = f;
|
||||
|
|
Loading…
Reference in New Issue