~mdw
/
fwd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
configure.ac: Hack around Termux syslog weirdness.
[fwd]
/
file.c
diff --git
a/file.c
b/file.c
index
8b4f533
..
5da247c
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-457,6
+457,8
@@
static source *fsource_read(scanner *sc)
return (0);
fs = CREATE(fsource);
fs->s.ops = &fsource_ops;
return (0);
fs = CREATE(fsource);
fs->s.ops = &fsource_ops;
+ fs->s.ref = 1;
+ fs->s.f = 0;
fs->s.desc = 0;
file_read(&fs->f, sc);
return (&fs->s);
fs->s.desc = 0;
file_read(&fs->f, sc);
return (&fs->s);
@@
-485,18
+487,12
@@
static void fsource_attach(source *s, scanner *sc, target *t)
/* --- And then create the endpoints --- */
if ((ee = t->ops->create(t, fs->s.desc)) == 0)
/* --- And then create the endpoints --- */
if ((ee = t->ops->create(t, fs->s.desc)) == 0)
-
goto tidy
;
+
return
;
if ((e = file_endpt(&fs->f, fs->s.desc)) == 0) {
ee->ops->close(ee);
if ((e = file_endpt(&fs->f, fs->s.desc)) == 0) {
ee->ops->close(ee);
-
goto tidy
;
+
return
;
}
endpt_join(e, ee, fs->s.desc);
}
endpt_join(e, ee, fs->s.desc);
-
- /* --- Dispose of the source and target now --- */
-
-tidy:
- t->ops->destroy(t);
- fsource_destroy(&fs->s);
}
/* --- @destroy@ --- */
}
/* --- @destroy@ --- */
@@
-513,7
+509,7
@@
static void fsource_destroy(source *s)
source_ops fsource_ops = {
"file",
source_ops fsource_ops = {
"file",
- fsource_option, fsource_read, fsource_attach, fsource_destroy
+ fsource_option, fsource_read, fsource_attach,
0,
fsource_destroy
};
/*----- File target description -------------------------------------------*/
};
/*----- File target description -------------------------------------------*/
@@
-537,6
+533,7
@@
static target *ftarget_read(scanner *sc)
return (0);
ft = CREATE(ftarget);
ft->t.ops = &ftarget_ops;
return (0);
ft = CREATE(ftarget);
ft->t.ops = &ftarget_ops;
+ ft->t.ref = 1;
file_read(&ft->f, sc);
file_desc(&ft->f, &d);
ft->t.desc = xstrdup(d.buf);
file_read(&ft->f, sc);
file_desc(&ft->f, &d);
ft->t.desc = xstrdup(d.buf);