X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Frepl.c;h=ab8042fe5bf96b39150ad7d20be80fe89dd9e398;hb=c16dc1b7987ffd6e7dde224192862691515a09ec;hp=d7c09ac8be19336140aadacb13b9c68e488eb4e3;hpb=1e6e0b5cc1bd2d49ffcef4ea7bb1bb6c256d07b7;p=mmh diff --git a/uip/repl.c b/uip/repl.c index d7c09ac..ab8042f 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -2,10 +2,13 @@ /* * repl.c -- reply to 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 static struct swit switches[] = { @@ -62,14 +65,11 @@ static struct swit switches[] = { #define VERSIONSW 25 { "version", 0 }, #define HELPSW 26 - { "help", 4 }, + { "help", 0 }, #define FILESW 27 - { "file file", -4 }, /* interface from msh */ - -#ifdef MHE + { "file file", 4 }, /* interface from msh */ #define BILDSW 28 - { "build", -5 }, /* interface from mhe */ -#endif + { "build", 5 }, /* interface from mhe */ { NULL, 0 } }; @@ -108,9 +108,9 @@ static struct swit aqrl[] = { { NULL, 0 } }; -short ccto = 0; /* global for replsbr */ -short cccc = 0; -short ccme = 0; +short ccto = -1; /* global for replsbr */ +short cccc = -1; +short ccme = -1; short querysw = 0; short outputlinelen = OUTPUTLINELEN; @@ -142,9 +142,7 @@ main (int argc, char **argv) struct stat st; FILE *in; -#ifdef MHE int buildsw = 0; -#endif /* MHE */ #ifdef LOCALE setlocale(LC_ALL, ""); @@ -177,11 +175,9 @@ main (int argc, char **argv) case GROUPSW: groupreply++; - ccto = cccc = ccme = 1; continue; case NGROUPSW: groupreply = 0; - ccto = cccc = ccme = 0; continue; case ANNOSW: @@ -216,10 +212,8 @@ main (int argc, char **argv) adios (NULL, "missing argument to %s", argp[-2]); nwhat = 0; continue; -#ifdef MHE case BILDSW: buildsw++; /* fall... */ -#endif /* MHE */ case NWHATSW: nwhat++; continue; @@ -316,7 +310,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!"); @@ -325,6 +319,13 @@ main (int argc, char **argv) } } + if (ccto == -1) + ccto = groupreply; + if (cccc == -1) + cccc = groupreply; + if (ccme == -1) + ccme = groupreply; + cwd = getcpy (pwd ()); if (!context_find ("path")) @@ -334,18 +335,11 @@ main (int argc, char **argv) try_it_again: -#ifdef MHE strncpy (drft, buildsw ? m_maildir ("reply") : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft)); /* Check if a draft exists */ if (!buildsw && stat (drft, &st) != NOTOK) { -#else - strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft)); - - /* Check if a draft exists */ - if (stat (drft, &st) != NOTOK) { -#endif /* MHE */ printf ("Draft \"%s\" exists (%ld bytes).", drft, (long) st.st_size); for (i = LISTDSW; i != YESW;) { if (!(argp = getans ("\nDisposition? ", isdf ? aqrnl : aqrl))) @@ -432,7 +426,8 @@ try_it_again: done (0); what_now (ed, nedit, NOUSE, drft, msg, 0, mp, anot ? "Replied" : NULL, inplace, cwd); - return done (1); + done (1); + return 1; } void