X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fdist.c;h=b7799beb7067e50cb65c5c3e371a62dbc258d4f2;hb=363d8b056113f4a54e84149977eac95505e38d59;hp=807eb78bbf4afe2fe27612b5ef24ace2275cbd4f;hpb=c8f2ee90aba3d5db2cbf170b3c2f7e4ea1d84aeb;p=mmh diff --git a/uip/dist.c b/uip/dist.c index 807eb78..b7799be 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -52,6 +52,10 @@ static struct swit switches[] = { { "fcc mailbox", 0 }, #define WIDTHSW 19 { "width columns", 0 }, +#define ATFILESW 20 + { "atfile", 0 }, +#define NOATFILESW 21 + { "noatfile", 0 }, { NULL, 0 } }; @@ -85,7 +89,7 @@ main (int argc, char **argv) int anot = 0, inplace = 1, nedit = 0; int nwhat = 0, i, in, isdf = 0, out; int outputlinelen = OUTPUTLINELEN; - int dat[5]; + int dat[5], atfile = 0; char *cp, *cwd, *maildir, *msgnam, *dfolder = NULL; char *dmsg = NULL, *ed = NULL, *file = NULL, *folder = NULL; char *form = NULL, *msg = NULL, buf[BUFSIZ], drft[BUFSIZ]; @@ -118,10 +122,10 @@ main (int argc, char **argv) snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name); print_help (buf, switches, 1); - done (1); + done (0); case VERSIONSW: print_version(invo_name); - done (1); + done (0); case ANNOSW: anot++; @@ -213,6 +217,13 @@ main (int argc, char **argv) if ((outputlinelen = atoi(cp)) < 10) adios (NULL, "impossible width %d", outputlinelen); continue; + + case ATFILESW: + atfile++; + continue; + case NOATFILESW: + atfile = 0; + continue; } } if (*cp == '+' || *cp == '@') { @@ -303,7 +314,7 @@ try_it_again: msgnam = file ? file : getcpy (m_name (mp->lowsel)); - dat[0] = mp->lowsel; + dat[0] = mp ? mp->lowsel : 0; dat[1] = 0; dat[2] = 0; dat[3] = outputlinelen; @@ -333,8 +344,8 @@ try_it_again: if (nwhat) done (0); - what_now (ed, nedit, NOUSE, drft, msgnam, 1, mp, - anot ? "Resent" : NULL, inplace, cwd); + what_now (ed, nedit, NOUSE, drft, msgnam, 1, mp, anot ? "Resent" : NULL, + inplace, cwd, atfile); done (1); return 1; }