X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fcomp.c;h=67cf83bb502199f9e23733d462d20b489cddf188;hb=56a805299de35d8924969138aef4d0f1580daa6d;hp=e40c968805f09782b8d67bcbca365097440e6045;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b;p=mmh diff --git a/uip/comp.c b/uip/comp.c index e40c968..67cf83b 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -3,9 +3,14 @@ * comp.c -- compose a message * * $Id$ + * + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include +#include #include static struct swit switches[] = { @@ -34,7 +39,7 @@ static struct swit switches[] = { #define VERSIONSW 11 { "version", 0 }, #define HELPSW 12 - { "help", 4 }, + { "help", 0 }, { NULL, 0 } }; @@ -167,7 +172,7 @@ main (int argc, char **argv) if (folder) adios (NULL, "only one folder at a time!"); else - folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF); + folder = pluspath (cp); } else { if (msg) adios (NULL, "only one message at a time!"); @@ -223,19 +228,8 @@ main (int argc, char **argv) if ((in = open (form = getcpy (m_name (mp->lowsel)), O_RDONLY)) == NOTOK) adios (form, "unable to open message"); - } else { - /* - * Open a component or forms file - */ - if (form) { - if ((in = open (etcpath (form), O_RDONLY)) == NOTOK) - adios (form, "unable to open form file"); - } else { - if ((in = open (etcpath (components), O_RDONLY)) == NOTOK) - adios (components, "unable to open default components file"); - form = components; - } - } + } else + in = open_form(&form, components); try_it_again: strncpy (drft, m_draft (dfolder, file, use, &isdf), sizeof(drft)); @@ -302,5 +296,5 @@ edit_it: if (nwhat) done (0); what_now (ed, nedit, use, drft, NULL, 0, NULLMP, NULL, 0, cwd); - done (1); + return done (1); }