X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Finc.c;h=05df0f02d07b0f44df6c93a16e2bbdce786b8ea1;hb=9e9e918ec2a607aca26253fe945ea9569475aae3;hp=6a756d9855f24302836557e3acc570bad53ab6a1;hpb=a7771fd2e83d64228fb675749fc936151249dbd3;p=mmh diff --git a/uip/inc.c b/uip/inc.c index 6a756d9..05df0f0 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -51,21 +50,19 @@ static struct swit switches[] = { { "file name", 0 }, #define FORMSW 5 { "form formatfile", 0 }, -#define FMTSW 6 - { "format string", 5 }, -#define SILSW 7 +#define SILSW 6 { "silent", 0 }, -#define NSILSW 8 +#define NSILSW 7 { "nosilent", 0 }, -#define TRNCSW 9 +#define TRNCSW 8 { "truncate", 0 }, -#define NTRNCSW 10 +#define NTRNCSW 9 { "notruncate", 0 }, -#define WIDTHSW 11 +#define WIDTHSW 10 { "width columns", 0 }, -#define VERSIONSW 12 +#define VERSIONSW 11 { "version", 0 }, -#define HELPSW 13 +#define HELPSW 12 { "help", 0 }, }; @@ -121,8 +118,6 @@ static FILE *in; /* ** prototypes */ -char *map_name(char *); - static void inc_done(int) NORETURN; @@ -137,9 +132,9 @@ main(int argc, char **argv) ** not truncate mailspool */ char *cp, *maildir = NULL, *folder = NULL; - char *format = NULL, *form = NULL; + char *form = NULL; char *audfile = NULL, *from = NULL; - char buf[BUFSIZ], **argp, *nfs, **arguments; + char buf[BUFSIZ], **argp, *fmtstr, **arguments; struct msgs *mp = NULL; struct stat st, s1; FILE *aud = NULL; @@ -168,7 +163,6 @@ main(int argc, char **argv) /* read user profile/context */ context_read(); - mts_init(invo_name); arguments = getarguments(invo_name, argc, argv, 1); argp = arguments; @@ -244,13 +238,6 @@ main(int argc, char **argv) if (!(form = *argp++) || *form == '-') adios(NULL, "missing argument to %s", argp[-2]); - format = NULL; - continue; - case FMTSW: - if (!(format = *argp++) || *format == '-') - adios(NULL, "missing argument to %s", - argp[-2]); - form = NULL; continue; case WIDTHSW: @@ -290,7 +277,7 @@ main(int argc, char **argv) else if ((newmail = context_find("maildrop")) && *newmail) newmail = toabsdir(newmail); else { - newmail = concat(MAILDIR, "/", MAILFIL, NULL); + newmail = concat(mailspool, "/", getusername(), NULL); } if (stat(newmail, &s1) == NOTOK || s1.st_size == 0) adios(NULL, "no mail to incorporate"); @@ -377,7 +364,7 @@ main(int argc, char **argv) #endif /* MHE */ /* Get new format string */ - nfs = new_fs(form, format, FORMAT); + fmtstr = new_fs(form, FORMAT); if (noisy) { printf("Incorporating new mail into %s...\n\n", folder); @@ -401,8 +388,9 @@ main(int argc, char **argv) } /* create scanline for new message */ - switch (incerr = scan(in, msgnum + 1, msgnum + 1, nfs, width, - msgnum == hghnum && chgflag, 1, NULL, 0L, noisy)) { + switch (incerr = scan(in, msgnum + 1, msgnum + 1, + noisy ? fmtstr : NULL, width, + msgnum == hghnum && chgflag, 1)) { case SCNFAT: case SCNEOF: break; @@ -425,7 +413,6 @@ main(int argc, char **argv) break; case SCNMSG: - case SCNENC: /* ** Run the external program hook on the message. */ @@ -497,7 +484,6 @@ main(int argc, char **argv) close(newfd); else admonish(newmail, "error zero'ing"); - unlink(map_name(newmail)); } } else if (noisy) { printf("%s not zero'd\n", newmail);