projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove h/nmh.h
[mmh]
/
uip
/
rcvstore.c
diff --git
a/uip/rcvstore.c
b/uip/rcvstore.c
index
5602dbc
..
0b5ad85
100644
(file)
--- a/
uip/rcvstore.c
+++ b/
uip/rcvstore.c
@@
-16,19
+16,19
@@
static struct swit switches[] = {
#define CRETSW 0
{ "create", 0 },
#define NCRETSW 1
#define CRETSW 0
{ "create", 0 },
#define NCRETSW 1
- { "nocreate", 0 },
+ { "nocreate", 2 },
#define UNSEENSW 2
{ "unseen", 0 },
#define NUNSEENSW 3
#define UNSEENSW 2
{ "unseen", 0 },
#define NUNSEENSW 3
- { "nounseen", 0 },
+ { "nounseen", 2 },
#define PUBSW 4
{ "public", 0 },
#define NPUBSW 5
#define PUBSW 4
{ "public", 0 },
#define NPUBSW 5
- { "nopublic", 0 },
+ { "nopublic", 2 },
#define ZEROSW 6
{ "zero", 0 },
#define NZEROSW 7
#define ZEROSW 6
{ "zero", 0 },
#define NZEROSW 7
- { "nozero", 0 },
+ { "nozero", 2 },
#define SEQSW 8
{ "sequence name", 0 },
#define VERSIONSW 9
#define SEQSW 8
{ "sequence name", 0 },
#define VERSIONSW 9
@@
-44,7
+44,7
@@
static struct swit switches[] = {
*/
static char *tmpfilenam = NULL;
*/
static char *tmpfilenam = NULL;
-static void unlink_done(int) NORETURN;
+void unlink_done();
int
main(int argc, char **argv)
int
main(int argc, char **argv)
@@
-58,11
+58,11
@@
main(int argc, char **argv)
struct msgs *mp;
struct stat st;
struct msgs *mp;
struct stat st;
- done=unlink_done;
+ if (atexit(unlink_done) != 0) {
+ adios(NULL, "atexit failed");
+ }
-#ifdef LOCALE
setlocale(LC_ALL, "");
setlocale(LC_ALL, "");
-#endif
invo_name = mhbasename(argv[0]);
/* read user profile/context */
invo_name = mhbasename(argv[0]);
/* read user profile/context */
@@
-77,7
+77,7
@@
main(int argc, char **argv)
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
- done(1);
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
@@
-86,10
+86,10
@@
main(int argc, char **argv)
"%s [+folder] [switches]",
invo_name);
print_help(buf, switches, 1);
"%s [+folder] [switches]",
invo_name);
print_help(buf, switches, 1);
- done(1);
+ exit(1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
- done(1);
+ exit(1);
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
@@
-188,7
+188,7
@@
main(int argc, char **argv)
if (st.st_size == 0) {
unlink(tmpfilenam);
advise(NULL, "empty file");
if (st.st_size == 0) {
unlink(tmpfilenam);
advise(NULL, "empty file");
- done(0);
+ exit(0);
}
/*
}
/*
@@
-203,7
+203,7
@@
main(int argc, char **argv)
*/
if ((msgnum = folder_addmsg(&mp, tmpfilenam, 0, unseensw, 0, 0, NULL))
== -1)
*/
if ((msgnum = folder_addmsg(&mp, tmpfilenam, 0, unseensw, 0, 0, NULL))
== -1)
- done(1);
+ exit(1);
/*
** Add the message to any extra sequences
/*
** Add the message to any extra sequences
@@
-211,7
+211,7
@@
main(int argc, char **argv)
*/
for (seqp = 0; seqs[seqp]; seqp++) {
if (!seq_addmsg(mp, seqs[seqp], msgnum, publicsw, zerosw))
*/
for (seqp = 0; seqs[seqp]; seqp++) {
if (!seq_addmsg(mp, seqs[seqp], msgnum, publicsw, zerosw))
- done(1);
+ exit(1);
}
seq_setunseen(mp, 1); /* add new msgs to unseen sequences */
}
seq_setunseen(mp, 1); /* add new msgs to unseen sequences */
@@
-222,17
+222,16
@@
main(int argc, char **argv)
unlink(tmpfilenam); /* remove temporary file */
tmpfilenam = NULL;
unlink(tmpfilenam); /* remove temporary file */
tmpfilenam = NULL;
- done(0);
- return 1;
+ return 0;
}
/*
** Clean up and exit
*/
}
/*
** Clean up and exit
*/
-static void
-unlink_done(int status)
+void
+unlink_done()
{
{
- if (tmpfilenam && *tmpfilenam)
+ if (tmpfilenam && *tmpfilenam) {
unlink(tmpfilenam);
unlink(tmpfilenam);
- exit(status);
+ }
}
}