X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fdist.c;h=4bad51ac1f4987528baaec21c41abd3ff65b431b;hp=f8769a0f235436965a7ad8cea9d2219dc9579cc0;hb=5dd6771b28c257af405d7248639ed0e3bcdce38b;hpb=197f95940cc0860683e6988352f721e6603f9339 diff --git a/uip/dist.c b/uip/dist.c index f8769a0..4bad51a 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -2,10 +2,13 @@ /* * dist.c -- re-distribute 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[] = { @@ -36,7 +39,7 @@ static struct swit switches[] = { #define VERSIONSW 12 { "version", 0 }, #define HELPSW 13 - { "help", 4 }, + { "help", 0 }, #define FILESW 14 { "file file", -4 }, /* interface from msh */ { NULL, 0 } @@ -175,7 +178,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!"); @@ -191,14 +194,7 @@ main (int argc, char **argv) if (file && (msg || folder)) adios (NULL, "can't mix files and folders/msgs"); - if (form) { - if ((in = open (etcpath (form), O_RDONLY)) == NOTOK) - adios (form, "unable to open form file"); - } else { - if ((in = open (etcpath (distcomps), O_RDONLY)) == NOTOK) - adios (distcomps, "unable to open default components file"); - form = distcomps; - } + in = open_form(&form, distcomps); try_it_again: strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft)); @@ -287,5 +283,6 @@ try_it_again: done (0); what_now (ed, nedit, NOUSE, drft, msgnam, 1, mp, anot ? "Resent" : NULL, inplace, cwd); - return done (1); + done (1); + return 1; }