From 003cacd23c8f80054990c5ad3303f9a115241583 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Thu, 9 Feb 2012 20:48:26 +0100 Subject: [PATCH] Replaced open_form() with new_fs() in forw.c. --- uip/forw.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/uip/forw.c b/uip/forw.c index feb60f9..38ede22 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -73,6 +73,7 @@ main(int argc, char **argv) char *folder = NULL; char *form = NULL, buf[BUFSIZ], value[10]; char **argp, **arguments, *msgs[MAXARGS]; + char *nfs; #ifdef MHE int buildsw = 0; @@ -213,6 +214,9 @@ main(int argc, char **argv) done(1); seq_setprev(mp); /* set the previous sequence */ + if ((out = creat(drft, m_gmprot())) == NOTOK) + adios(drft, "unable to create"); + /* Open form (component) file. */ if (digest) { if (issue == 0) { @@ -230,18 +234,16 @@ main(int argc, char **argv) if (!form) form = digestcomps; in = build_form(form, digest, volume, issue); - } else - in = open_form(&form, forwcomps); - - if ((out = creat(drft, m_gmprot())) == NOTOK) - adios(drft, "unable to create"); - - /* - ** copy the components into the draft - */ - cpydata(in, out, form, drft); - close(in); + cpydata(in, out, form, drft); + close(in); + } else { + nfs = new_fs(form, NULL, forwcomps, NULL); + if (write(out, nfs, strlen(nfs)) != strlen(nfs)) { + adios(drft, "error writing"); + } + } close(out); + add_forw_hdr(drft); if (digest) { -- 1.7.10.4