projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scan(): Replaced explicit noisy parameter with implicit nfs check.
[mmh]
/
uip
/
inc.c
diff --git
a/uip/inc.c
b/uip/inc.c
index
f712152
..
6546cea
100644
(file)
--- a/
uip/inc.c
+++ b/
uip/inc.c
@@
-34,7
+34,6
@@
#include <h/scansbr.h>
#include <h/signals.h>
#include <h/tws.h>
#include <h/scansbr.h>
#include <h/signals.h>
#include <h/tws.h>
-#include <h/mts.h>
#include <errno.h>
#include <signal.h>
#include <errno.h>
#include <signal.h>
@@
-51,21
+50,19
@@
static struct swit switches[] = {
{ "file name", 0 },
#define FORMSW 5
{ "form formatfile", 0 },
{ "file name", 0 },
#define FORMSW 5
{ "form formatfile", 0 },
-#define FMTSW 6
- { "format string", 5 },
-#define SILSW 7
+#define SILSW 6
{ "silent", 0 },
{ "silent", 0 },
-#define NSILSW 8
+#define NSILSW 7
{ "nosilent", 0 },
{ "nosilent", 0 },
-#define TRNCSW 9
+#define TRNCSW 8
{ "truncate", 0 },
{ "truncate", 0 },
-#define NTRNCSW 10
+#define NTRNCSW 9
{ "notruncate", 0 },
{ "notruncate", 0 },
-#define WIDTHSW 11
+#define WIDTHSW 10
{ "width columns", 0 },
{ "width columns", 0 },
-#define VERSIONSW 12
+#define VERSIONSW 11
{ "version", 0 },
{ "version", 0 },
-#define HELPSW 13
+#define HELPSW 12
{ "help", 0 },
};
{ "help", 0 },
};
@@
-121,8
+118,6
@@
static FILE *in;
/*
** prototypes
*/
/*
** prototypes
*/
-char *map_name(char *);
-
static void inc_done(int) NORETURN;
static void inc_done(int) NORETURN;
@@
-137,7
+132,7
@@
main(int argc, char **argv)
** not truncate mailspool
*/
char *cp, *maildir = NULL, *folder = NULL;
** 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;
struct msgs *mp = NULL;
char *audfile = NULL, *from = NULL;
char buf[BUFSIZ], **argp, *nfs, **arguments;
struct msgs *mp = NULL;
@@
-168,7
+163,6
@@
main(int argc, char **argv)
/* read user profile/context */
context_read();
/* read user profile/context */
context_read();
- mts_init(invo_name);
arguments = getarguments(invo_name, argc, argv, 1);
argp = arguments;
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]);
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:
continue;
case WIDTHSW:
@@
-290,7
+277,7
@@
main(int argc, char **argv)
else if ((newmail = context_find("maildrop")) && *newmail)
newmail = toabsdir(newmail);
else {
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");
}
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 */
#endif /* MHE */
/* Get new format string */
- nfs = new_fs(form, format, FORMAT);
+ nfs = new_fs(form, FORMAT);
if (noisy) {
printf("Incorporating new mail into %s...\n\n", folder);
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 */
}
/* 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 ? nfs : NULL, width,
+ msgnum == hghnum && chgflag, 1)) {
case SCNFAT:
case SCNEOF:
break;
case SCNFAT:
case SCNEOF:
break;
@@
-425,7
+413,6
@@
main(int argc, char **argv)
break;
case SCNMSG:
break;
case SCNMSG:
- case SCNENC:
/*
** Run the external program hook on the message.
*/
/*
** 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");
close(newfd);
else
admonish(newmail, "error zero'ing");
- unlink(map_name(newmail));
}
} else if (noisy) {
printf("%s not zero'd\n", newmail);
}
} else if (noisy) {
printf("%s not zero'd\n", newmail);
@@
-527,7
+513,7
@@
main(int argc, char **argv)
fclose(in); in = NULL;
}
fclose(in); in = NULL;
}
- seq_setunseen(mp, 0); /* set the Unseen-Sequence */
+ seq_setunseen(mp, 1); /* add new msgs to unseen sequences */
seq_save(mp); /* synchronize sequences */
context_save(); /* save the context file */
done(0);
seq_save(mp); /* synchronize sequences */
context_save(); /* save the context file */
done(0);