X-Git-Url: https://git.distorted.org.uk/~mdw/fwd/blobdiff_plain/86c9bc4bc9e9b99482bcc5a2c6da8f5ec7516f69..aae68c41bca575de5d57e0b3b84e272a225520fd:/file.c diff --git a/file.c b/file.c index cc319ce..88b7666 100644 --- a/file.c +++ b/file.c @@ -242,13 +242,15 @@ static void file_fspec(fspec *f, scanner *sc) static void file_read(fdata *f, scanner *sc) { file_fspec(&f->in, sc); - if (sc->t != ',') { + if (sc->t == ',') { + token(sc); + file_fspec(&f->out, sc); + } else { f->out = f->in; if (f->out.type == FTYPE_FD && f->out.u.fd == rstdin) f->out.u.fd = rstdout; - } else { - token(sc); - file_fspec(&f->out, sc); + else if (f->out.type == FTYPE_NAME) + f->out.u.name = xstrdup(f->in.u.name); } f->fa = fattr_global; f->fo = file_opts;