Replace done with exit in most sourcefiles of uip. This makes the
code better to read. If the done was overwritten by an externel function
atexit() is used instand.
send.c and mhl.c are excluded, because need a bit rewrite first.
40 files changed:
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
snprintf(buf, sizeof(buf), "%s [switches] aliases ...",
invo_name);
print_help(buf, switches, 1);
snprintf(buf, sizeof(buf), "%s [switches] aliases ...",
invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case FILESW:
if (!(cp = *argp++) || *cp == '-')
case FILESW:
if (!(cp = *argp++) || *cp == '-')
for (i = 0; i < vecp; i++)
print_usr(vec[i], list, normalize);
for (i = 0; i < vecp; i++)
print_usr(vec[i], list, normalize);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s [+folder] [msgs] [switches]",
invo_name);
print_help(buf, switches, 1);
"%s [+folder] [msgs] [switches]",
invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case DELETESW: /* delete annotations */
mode = MODE_DEL;
case DELETESW: /* delete annotations */
mode = MODE_DEL;
else
annotate(file, comp, text, datesw, number,
append, preserve);
else
annotate(file, comp, text, datesw, number,
append, preserve);
adios(NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios(NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < msgs.size; msgnum++)
- if (!m_convert(mp, msgs.msgs[msgnum]))
- done(1);
+ for (msgnum = 0; msgnum < msgs.size; msgnum++) {
+ if (!m_convert(mp, msgs.msgs[msgnum])) {
+ /* sysexits.h EX_USAGE */
+ exit(1);
+ }
+ }
/* annotate all the SELECTED messages */
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
/* annotate all the SELECTED messages */
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
seq_save(mp);
folder_free(mp);
context_save();
seq_save(mp);
folder_free(mp);
context_save();
fflush(stdout);
if (!fgets(buffer, sizeof buffer, stdin)) {
fflush(stdout);
if (!fgets(buffer, sizeof buffer, stdin)) {
+ /* sysexits.h EX_IOERR */
+ exit(1);
}
*ap = trimcpy(buffer);
}
}
*ap = trimcpy(buffer);
}
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] addrs ...", invo_name);
print_help(buf, switches, 1);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] addrs ...", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
for (addrp = 0; addrs[addrp]; addrp++)
status += process(addrs[addrp], normalize);
for (addrp = 0; addrs[addrp]; addrp++)
status += process(addrs[addrp], normalize);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgp; msgnum++)
if (!m_convert(mp, msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgp; msgnum++)
if (!m_convert(mp, msgs[msgnum]))
+ /* sysexits.h EX_USAGE */
+ exit(1);
seq_setprev(mp); /* set the previous-sequence */
smsgs = (struct smsg *)
seq_setprev(mp); /* set the previous-sequence */
smsgs = (struct smsg *)
seq_save(mp);
context_save();
folder_free(mp);
seq_save(mp);
context_save();
folder_free(mp);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
adios(NULL, "no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert(mp, msg))
adios(NULL, "no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert(mp, msg))
+ /* sysexits.h EX_USAGE */
+ exit(1);
seq_setprev(mp); /* set the previous-sequence */
if (mp->numsel > 1)
adios(NULL, "only one message at a time!");
seq_setprev(mp); /* set the previous-sequence */
if (mp->numsel > 1)
adios(NULL, "only one message at a time!");
context_save();
what_now(ed, use, drft, NULL, 0, NULLMP, NULL, cwd);
context_save();
what_now(ed, use, drft, NULL, 0, NULLMP, NULL, cwd);
+ /* sysexits.h EX_SOFTWARE */
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE*/
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert(mp, msg))
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert(mp, msg))
+ /* sysexits.h EX_USAGE*/
+ exit(1);
seq_setprev(mp);
if (mp->numsel > 1)
seq_setprev(mp);
if (mp->numsel > 1)
context_save();
what_now(ed, NOUSE, drft, msgnam, 1, mp, anot ? "Resent" : NULL, cwd);
context_save();
what_now(ed, NOUSE, drft, msgnam, 1, mp, anot ? "Resent" : NULL, cwd);
+ /*sysexits.h EX_SOFTWARE*/
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] dates ...", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] dates ...", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
status += process(dates[datep]);
context_save(); /* save the context file */
status += process(dates[datep]);
context_save(); /* save the context file */
- done(status);
- return 1;
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder1 [+folder2 ...]][switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder1 [+folder2 ...]][switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
qsort(folders, nFolders, sizeof(struct Folder),
(qsort_comp) CompareFolders);
PrintFolders();
qsort(folders, nFolders, sizeof(struct Folder),
(qsort_comp) CompareFolders);
PrintFolders();
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /*sysexits.h EX_USAGE*/
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
snprintf(buf, sizeof(buf), "%s [switches]",
invo_name);
print_help(buf, switches, 1);
snprintf(buf, sizeof(buf), "%s [switches]",
invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
fmt_compile(fmtstr, &fmt);
fmt_dump(fmt);
fmt_compile(fmtstr, &fmt);
fmt_dump(fmt);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /*sysexits.h EX_USAGE*/
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
- if (!printsw)
- done(0);
+ if (!printsw) {
+ exit(0);
+ }
}
/* Allocate initial space to record folder information */
}
/* Allocate initial space to record folder information */
print_folders();
context_save();
print_folders();
context_save();
- if (folder_pack(&mp, fverb) == -1)
- done(1);
+ if (folder_pack(&mp, fverb) == -1) {
+ exit(0);
+ }
seq_save(mp); /* synchronize the sequences */
context_save(); /* save the context file */
}
seq_save(mp); /* synchronize the sequences */
context_save(); /* save the context file */
}
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
adios(NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios(NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < msgp; msgnum++)
- if (!m_convert(mp, msgs[msgnum]))
- done(1);
+ for (msgnum = 0; msgnum < msgp; msgnum++) {
+ if (!m_convert(mp, msgs[msgnum])) {
+ /* sysexits.h EX_USAGE */
+ exit(1);
+ }
+ }
seq_setprev(mp); /* set the previous sequence */
if ((out = creat(drft, m_gmprot())) == NOTOK)
seq_setprev(mp); /* set the previous sequence */
if ((out = creat(drft, m_gmprot())) == NOTOK)
context_save(); /* save the context file */
if (buildsw)
context_save(); /* save the context file */
if (buildsw)
what_now(ed, NOUSE, drft, NULL, 0, mp,
anot ? "Forwarded" : NULL, cwd);
what_now(ed, NOUSE, drft, NULL, 0, mp,
anot ? "Forwarded" : NULL, cwd);
+ /* sysexits.h EX_SOFTWARE */
-static void inc_done(int) NORETURN;
/* copy of mail directory because the static gets overwritten */
char *maildir_copy = NULL;
/* copy of mail directory because the static gets overwritten */
char *maildir_copy = NULL;
/*
** absolutely the first thing we do is save our privileges,
/*
** absolutely the first thing we do is save our privileges,
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case AUDSW:
if (!(cp = *argp++) || *cp == '-')
case AUDSW:
if (!(cp = *argp++) || *cp == '-')
seq_setunseen(mp, 1); /* add new msgs to unseen sequences */
seq_save(mp); /* synchronize sequences */
context_save(); /* save the context file */
seq_setunseen(mp, 1); /* add new msgs to unseen sequences */
seq_save(mp); /* synchronize sequences */
context_save(); /* save the context file */
{
if (locked) {
GETGROUPPRIVS();
lkfclose(in, newmail);
DROPGROUPPRIVS();
}
{
if (locked) {
GETGROUPPRIVS();
lkfclose(in, newmail);
DROPGROUPPRIVS();
}
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /*sysexits.h EX_USAGE*/
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
adios(NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios(NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < msgs.size; msgnum++)
- if (!m_convert(mp, msgs.msgs[msgnum]))
- done(1);
+ for (msgnum = 0; msgnum < msgs.size; msgnum++) {
+ if (!m_convert(mp, msgs.msgs[msgnum])) {
+ /*sysexits.h EX_USAGE*/
+ exit(1);
+ }
+ }
if (publicsw == 1 && is_readonly(mp))
adios(NULL, "folder %s is read-only, so -public not allowed",
if (publicsw == 1 && is_readonly(mp))
adios(NULL, "folder %s is read-only, so -public not allowed",
/* Adding messages to sequences */
if (addsw) {
/* Adding messages to sequences */
if (addsw) {
- for (seqp = 0; seqs[seqp]; seqp++)
- if (!seq_addsel(mp, seqs[seqp], publicsw, zerosw))
- done(1);
+ for (seqp = 0; seqs[seqp]; seqp++) {
+ if (!seq_addsel(mp, seqs[seqp], publicsw, zerosw)) {
+ /*TODO find best exitcode*/
+ exit(1);
+ }
+ }
}
/* Deleting messages from sequences */
if (deletesw) {
for (seqp = 0; seqs[seqp]; seqp++)
if (!seq_delsel(mp, seqs[seqp], publicsw, zerosw))
}
/* Deleting messages from sequences */
if (deletesw) {
for (seqp = 0; seqs[seqp]; seqp++)
if (!seq_delsel(mp, seqs[seqp], publicsw, zerosw))
+ /*TODO find best exitcode*/
+ exit(1);
}
/* Listing messages in sequences */
}
/* Listing messages in sequences */
context_replace(curfolder, folder); /* update current folder */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
context_replace(curfolder, folder); /* update current folder */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
static char outfile[BUFSIZ];
static int unlink_outfile = 0;
static char outfile[BUFSIZ];
static int unlink_outfile = 0;
-static void unlink_done(int) NORETURN;
+static void unlink_done();
/* mhoutsbr.c */
int output_message(CT, char *);
/* mhoutsbr.c */
int output_message(CT, char *);
FILE *fp = NULL;
FILE *fp_out = NULL;
FILE *fp = NULL;
FILE *fp_out = NULL;
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] file", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] file", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
unlink_outfile = 0;
free_content(ct);
unlink_outfile = 0;
free_content(ct);
if (rename(outfile, compfile) == NOTOK) {
advise(compfile, "unable to rename output %s to", outfile);
rename(buffer, compfile);
if (rename(outfile, compfile) == NOTOK) {
advise(compfile, "unable to rename output %s to", outfile);
rename(buffer, compfile);
+ /* sysexits.h EX_IOERR */
+ exit(1);
}
unlink_outfile = 0;
free_content(ct);
}
unlink_outfile = 0;
free_content(ct);
{
/*
** Check if we need to remove stray temporary files.
*/
{
/*
** Check if we need to remove stray temporary files.
*/
+ }
+ if (unlink_outfile) {
** draft. So create a multipart/mixed content to hold everything.
** We can remove this later, if it is not needed.
*/
** draft. So create a multipart/mixed content to hold everything.
** We can remove this later, if it is not needed.
*/
- if (get_ctinfo("multipart/mixed", ct, 0) == NOTOK)
- done(1);
+ if (get_ctinfo("multipart/mixed", ct, 0) == NOTOK) {
+ /* sysexits.h EX_DATAERR */
+ exit(1);
+ }
ct->c_type = CT_MULTIPART;
ct->c_subtype = MULTI_MIXED;
ct->c_file = getcpy(infile);
ct->c_type = CT_MULTIPART;
ct->c_subtype = MULTI_MIXED;
ct->c_file = getcpy(infile);
/* parse content type */
if (get_ctinfo(content, ct, inlineD) == NOTOK)
/* parse content type */
if (get_ctinfo(content, ct, inlineD) == NOTOK)
+ /* sysexits.h EX_USAGE */
+ exit(1);
for (s2i = str2cts; s2i->si_key; s2i++)
if (!mh_strcasecmp(ci->ci_type, s2i->si_key))
for (s2i = str2cts; s2i->si_key; s2i++)
if (!mh_strcasecmp(ci->ci_type, s2i->si_key))
/* parse directive */
if (get_ctinfo(buf+1, ct, 1) == NOTOK)
/* parse directive */
if (get_ctinfo(buf+1, ct, 1) == NOTOK)
+ /* sysexits.h EX_DATAERR */
+ exit(1);
/* check directive against the list of MIME types */
for (s2i = str2cts; s2i->si_key; s2i++)
/* check directive against the list of MIME types */
for (s2i = str2cts; s2i->si_key; s2i++)
if ((cp = context_find(buffer)) == NULL ||
*cp == '\0') {
content_error(NULL, ct, "don't know how to compose content");
if ((cp = context_find(buffer)) == NULL ||
*cp == '\0') {
content_error(NULL, ct, "don't know how to compose content");
+ /* sysexits.h EX_USAGE */
+ exit(1);
}
}
ci->ci_magic = getcpy(cp);
}
}
ci->ci_magic = getcpy(cp);
cp = *ap;
if (*cp != '+' && *cp != '@')
if (!m_convert(mp, cp))
cp = *ap;
if (*cp != '+' && *cp != '@')
if (!m_convert(mp, cp))
+ /* sysexits.h EX_USAGE */
+ exit(1);
}
free(folder);
free_ctinfo(ct);
}
free(folder);
free_ctinfo(ct);
if (mp->numsel > 1) {
/* we are forwarding multiple messages */
if (get_ctinfo("multipart/digest", ct, 0) == NOTOK)
if (mp->numsel > 1) {
/* we are forwarding multiple messages */
if (get_ctinfo("multipart/digest", ct, 0) == NOTOK)
+ /* sysexits.h EX_DATAERR */
+ exit(1);
ct->c_type = CT_MULTIPART;
ct->c_subtype = MULTI_DIGEST;
ct->c_type = CT_MULTIPART;
ct->c_subtype = MULTI_DIGEST;
pe = p->c_cefile;
if (get_ctinfo("message/rfc822", p, 0)
== NOTOK)
pe = p->c_cefile;
if (get_ctinfo("message/rfc822", p, 0)
== NOTOK)
+ /* sysexits.h EX_DATAERR */
+ exit(1);
p->c_type = CT_MESSAGE;
p->c_subtype = MESSAGE_RFC822;
p->c_type = CT_MESSAGE;
p->c_subtype = MESSAGE_RFC822;
} else {
/* we are forwarding one message */
if (get_ctinfo("message/rfc822", ct, 0) == NOTOK)
} else {
/* we are forwarding one message */
if (get_ctinfo("message/rfc822", ct, 0) == NOTOK)
+ /* sysexits.h EX_DATAERR */
+ exit(1);
ct->c_type = CT_MESSAGE;
ct->c_subtype = MESSAGE_RFC822;
ct->c_type = CT_MESSAGE;
ct->c_subtype = MESSAGE_RFC822;
free_ctinfo(ct);
snprintf(buffer, sizeof(buffer), "multipart/%s", cp);
if (get_ctinfo(buffer, ct, 0) == NOTOK)
free_ctinfo(ct);
snprintf(buffer, sizeof(buffer), "multipart/%s", cp);
if (get_ctinfo(buffer, ct, 0) == NOTOK)
+ /* sysexits.h EX_DATAERR */
+ exit(1);
ct->c_type = CT_MULTIPART;
ct->c_subtype = vrsn;
ct->c_type = CT_MULTIPART;
ct->c_subtype = vrsn;
default:
fclose(out);
if (pidXwait(child_id, NULL))
default:
fclose(out);
if (pidXwait(child_id, NULL))
+ /* sysexits.h EX_SOFTWARE */
+ exit(1);
void free_header(CT);
void free_ctinfo(CT);
void free_encoding(CT, int);
void free_header(CT);
void free_ctinfo(CT);
void free_encoding(CT, int);
-freects_done(int status)
- if ((ctp = cts))
- for (; *ctp; ctp++)
+ if ((ctp = cts)) {
+ for (; *ctp; ctp++){
/* mhfree.c */
void free_content(CT);
extern CT *cts;
/* mhfree.c */
void free_content(CT);
extern CT *cts;
-void freects_done(int) NORETURN;
struct msgs *mp = NULL;
CT ct, *ctp;
struct msgs *mp = NULL;
CT ct, *ctp;
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
adios(NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios(NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < msgs.size; msgnum++)
- if (!m_convert(mp, msgs.msgs[msgnum]))
- done (1);
+ for (msgnum = 0; msgnum < msgs.size; msgnum++) {
+ if (!m_convert(mp, msgs.msgs[msgnum])) {
+ /* sysexits.h EX_USAGE */
+ exit(1);
+ }
+ }
seq_setprev(mp); /* set the previous-sequence */
if (!(cts = (CT *) calloc((size_t) (mp->numsel + 1),
seq_setprev(mp); /* set the previous-sequence */
if (!(cts = (CT *) calloc((size_t) (mp->numsel + 1),
userrs = 1;
SIGNAL(SIGQUIT, quitser);
userrs = 1;
SIGNAL(SIGQUIT, quitser);
context_save(); /* save the context file */
}
context_save(); /* save the context file */
}
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s addrs... [switches]",
invo_name);
print_help(buf, switches, 0);
"%s addrs... [switches]",
invo_name);
print_help(buf, switches, 0);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case FROMSW:
if (!(from = *argp++) || *from == '-')
case FROMSW:
if (!(from = *argp++) || *from == '-')
if (in == -1 || out == -1) {
fprintf(stderr, "Letter left at %s.\n",
tmpfil);
if (in == -1 || out == -1) {
fprintf(stderr, "Letter left at %s.\n",
tmpfil);
+ /* sysexits.h exit-status from spost */
+ exit(status ? 1 : 0);
}
cpydata(in, out, tmpfil, "dead.letter");
close(in);
}
cpydata(in, out, tmpfil, "dead.letter");
close(in);
fprintf(stderr, "Letter saved in dead.letter\n");
}
unlink(tmpfil);
fprintf(stderr, "Letter saved in dead.letter\n");
}
unlink(tmpfil);
+ /* sysexits.h exit status from spost */
+ exit(status ? 1 : 0);
}
return 0; /* dead code to satisfy the compiler */
}
return 0; /* dead code to satisfy the compiler */
intrser(int i)
{
unlink(tmpfil);
intrser(int i)
{
unlink(tmpfil);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /*sysexits.h EX_USAGE*/
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [profile-components] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [profile-components] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case COMPSW:
components = 1;
case COMPSW:
components = 1;
- done(missed);
- return 1;
fflush(stdout);
fflush(stderr);
fflush(stdout);
fflush(stderr);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ exit(1); //sysexits.h EX_TEMPFAIL
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
+ exit(0); //sysexits.h EX_OK
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
+ exit(0); //sysexits.h EX_OK
}
}
if (*cp == '+' || *cp == '@') {
}
}
if (*cp == '+' || *cp == '@') {
/* If no messages are given, print folder pathname */
if (!msgs.size) {
printf("%s\n", maildir);
/* If no messages are given, print folder pathname */
if (!msgs.size) {
printf("%s\n", maildir);
+ exit(0); //sysexits.h EX_OK
}
if (chdir(maildir) == NOTOK)
}
if (chdir(maildir) == NOTOK)
mp->msgflags |= ALLOW_BEYOND; /* allow the beyond sequence */
/* parse all the message ranges/sequences and set SELECTED */
mp->msgflags |= ALLOW_BEYOND; /* allow the beyond sequence */
/* parse all the message ranges/sequences and set SELECTED */
- for (i = 0; i < msgs.size; i++)
- if (!m_convert(mp, msgs.msgs[i]))
- done(1);
+ for (i = 0; i < msgs.size; i++) {
+ if (!m_convert(mp, msgs.msgs[i])) {
+ exit(1); //sysexits.h EX_USAGE
+ }
+ }
seq_setprev(mp); /* set the previous-sequence */
seq_setprev(mp); /* set the previous-sequence */
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
/* mhfree.c */
void free_content(CT);
extern CT *cts;
/* mhfree.c */
void free_content(CT);
extern CT *cts;
-void freects_done(int) NORETURN;
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
+ /* sysexits.h EX_USAGE */
+ exit(1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] %s[switches]", invo_name, mode==SHOW ? "[msgs] " : "");
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] %s[switches]", invo_name, mode==SHOW ? "[msgs] " : "");
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
+ /* sysexits.h EX_USAGE */
+ exit(1);
/*
** Set the SELECT_UNSEEN bit for all the SELECTED messages,
/*
** Set the SELECT_UNSEEN bit for all the SELECTED messages,
userrs = 1;
SIGNAL(SIGQUIT, quitser);
userrs = 1;
SIGNAL(SIGQUIT, quitser);
context_save(); /* save the context file */
}
context_save(); /* save the context file */
}
/* mhfree.c */
void free_content(CT);
extern CT *cts; /* The list of top-level contents to display */
/* mhfree.c */
void free_content(CT);
extern CT *cts; /* The list of top-level contents to display */
-void freects_done(int) NORETURN;
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
seq_setprev(mp); /* set the previous-sequence */
if (!(cts = (CT *) calloc((size_t) (mp->numsel + 1),
seq_setprev(mp); /* set the previous-sequence */
if (!(cts = (CT *) calloc((size_t) (mp->numsel + 1),
userrs = 1;
SIGNAL(SIGQUIT, quitser);
userrs = 1;
SIGNAL(SIGQUIT, quitser);
context_save(); /* save the context file */
}
context_save(); /* save the context file */
}
/* mhfree.c */
void free_content(CT);
extern CT *cts;
/* mhfree.c */
void free_content(CT);
extern CT *cts;
-void freects_done(int) NORETURN;
struct msgs *mp = NULL;
CT ct, *ctp;
struct msgs *mp = NULL;
CT ct, *ctp;
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
seq_setprev(mp); /* set the previous-sequence */
if (!(cts = (CT *) calloc((size_t) (mp->numsel + 1),
seq_setprev(mp); /* set the previous-sequence */
if (!(cts = (CT *) calloc((size_t) (mp->numsel + 1),
userrs = 1;
SIGNAL(SIGQUIT, quitser);
userrs = 1;
SIGNAL(SIGQUIT, quitser);
context_save(); /* save the context file */
}
context_save(); /* save the context file */
}
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s [switches] [sequences]",
invo_name);
print_help(help, switches, 1);
"%s [switches] [sequences]",
invo_name);
print_help(help, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case FOLDERSSW:
if (!(folders = *argp++) || *folders == '-')
case FOLDERSSW:
if (!(folders = *argp++) || *folders == '-')
folder = doit(context_find(curfolder), folders, sequences);
if (folder == NULL) {
folder = doit(context_find(curfolder), folders, sequences);
if (folder == NULL) {
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
}
}
if (*cp == '+' || *cp == '@') {
}
}
if (*cp == '+' || *cp == '@') {
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
seq_setprev(mp); /* set the previous-sequence */
/* copy all the SELECTED messages to stdout */
seq_setprev(mp); /* set the previous-sequence */
/* copy all the SELECTED messages to stdout */
seq_save(mp);
context_save();
folder_free(mp);
seq_save(mp);
context_save();
folder_free(mp);
-static void putzero_done(int) NORETURN;
+static void putzero_done();
int
main(int argc, char **argv)
int
main(int argc, char **argv)
struct msgs *mp;
register FILE *fp;
struct msgs *mp;
register FILE *fp;
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
case AMBIGSW:
ambigsw(cp, switches);
listsw = 0; /* HACK */
case AMBIGSW:
ambigsw(cp, switches);
listsw = 0; /* HACK */
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
listsw = 0; /* HACK */
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
listsw = 0; /* HACK */
case VERSIONSW:
print_version(invo_name);
listsw = 0; /* HACK */
case VERSIONSW:
print_version(invo_name);
listsw = 0; /* HACK */
adios(NULL, "too many sequences (more than %d) specified", NUMATTRS);
if (!seq_nameok(cp))
adios(NULL, "too many sequences (more than %d) specified", NUMATTRS);
if (!seq_nameok(cp))
+ /* sysexits.h EX_USAGE */
+ exit(1);
seqs[seqp++] = cp;
continue;
seqs[seqp++] = cp;
continue;
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
seq_setprev(mp); /* set the previous-sequence */
/*
seq_setprev(mp); /* set the previous-sequence */
/*
folder);
if (!pcompile(vec, NULL))
folder);
if (!pcompile(vec, NULL))
+ /* sysexits.h EX_USAGE */
+ exit(1);
lo = mp->lowsel;
hi = mp->hghsel;
lo = mp->lowsel;
hi = mp->hghsel;
*/
for (seqp = 0; seqs[seqp]; seqp++)
if (!seq_addsel(mp, seqs[seqp], publicsw, zerosw))
*/
for (seqp = 0; seqs[seqp]; seqp++)
if (!seq_addsel(mp, seqs[seqp], publicsw, zerosw))
+ /* sysexits.h EX_IOERR */
+ exit(1);
/*
** Print total matched if not printing each matched message number.
/*
** Print total matched if not printing each matched message number.
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
-putzero_done(int status)
- if (listsw && status && !isatty(fileno(stdout)))
+ if (listsw && !isatty(fileno(stdout))) {
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s [switches] file",
invo_name);
print_help(buffer, switches, 1);
"%s [switches] file",
invo_name);
print_help(buffer, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
if (i == -1) {
abort:
unlink(tmpfil);
if (i == -1) {
abort:
unlink(tmpfil);
+ /* sysexits.h EX_DATAERR */
+ exit(1);
}
if (i || (field[0]!='\n' && field[0]!='\0')) {
fprintf(out, "%s:", name);
}
if (i || (field[0]!='\n' && field[0]!='\0')) {
fprintf(out, "%s:", name);
unlink(tmpfil);
context_save(); /* save the context file */
unlink(tmpfil);
context_save(); /* save the context file */
** prototypes
*/
static void rcvdistout(FILE *, char *, char *);
** prototypes
*/
static void rcvdistout(FILE *, char *, char *);
-static void unlink_done(int) NORETURN;
+static void unlink_done();
FILE *fp;
char *tfile = NULL;
FILE *fp;
char *tfile = NULL;
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
vec[vecp++] = --cp;
continue;
case UNKWNSW:
vec[vecp++] = --cp;
continue;
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] [switches for spost] address ...", invo_name);
print_help(buf, switches, 1);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] [switches for spost] address ...", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case FORMSW:
if (!(form = *argp++) || *form == '-') {
case FORMSW:
if (!(form = *argp++) || *form == '-') {
fclose(fp);
if (distout(drft, tmpfil, backup) == NOTOK) {
fclose(fp);
if (distout(drft, tmpfil, backup) == NOTOK) {
+ /* sysexits.h EX_DATAERR */
+ exit(1);
{
if (*backup) {
unlink(backup);
{
if (*backup) {
unlink(backup);
if (*tmpfil) {
unlink(tmpfil);
}
if (*tmpfil) {
unlink(tmpfil);
}
- exit(status ? RCV_MBX : RCV_MOK);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s [switches] file",
invo_name);
print_help(buf, switches, 1);
"%s [switches] file",
invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
/* copy stdin to stdout, converting rfc822 message to mbox */
if (!file) {
if (mbox_copy(fileno(stdout), fileno(stdin)) == NOTOK) {
/* copy stdin to stdout, converting rfc822 message to mbox */
if (!file) {
if (mbox_copy(fileno(stdout), fileno(stdin)) == NOTOK) {
return 1;
}
/* open and lock the file */
if ((md = mbox_open(file, getuid(), getgid(), m_gmprot()))
== NOTOK)
return 1;
}
/* open and lock the file */
if ((md = mbox_open(file, getuid(), getgid(), m_gmprot()))
== NOTOK)
/* append the message */
if (mbox_copy(md, fileno(stdin)) == NOTOK) {
mbox_close(file, md);
/* append the message */
if (mbox_copy(md, fileno(stdin)) == NOTOK) {
mbox_close(file, md);
}
/* close and unlock the file */
if (mbox_close(file, md) == NOTOK)
}
/* close and unlock the file */
if (mbox_close(file, md) == NOTOK)
*/
static char *tmpfilenam = NULL;
*/
static char *tmpfilenam = NULL;
-static void unlink_done(int) NORETURN;
+static void unlink_done();
int
main(int argc, char **argv)
int
main(int argc, char **argv)
struct msgs *mp;
struct stat st;
struct msgs *mp;
struct stat st;
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
setlocale(LC_ALL, "");
invo_name = mhbasename(argv[0]);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s [+folder] [switches]",
invo_name);
print_help(buf, switches, 1);
"%s [+folder] [switches]",
invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
if (st.st_size == 0) {
unlink(tmpfilenam);
advise(NULL, "empty file");
if (st.st_size == 0) {
unlink(tmpfilenam);
advise(NULL, "empty file");
*/
if ((msgnum = folder_addmsg(&mp, tmpfilenam, 0, unseensw, 0, 0, NULL))
== -1)
*/
if ((msgnum = folder_addmsg(&mp, tmpfilenam, 0, unseensw, 0, 0, NULL))
== -1)
/*
** Add the message to any extra sequences
/*
** Add the message to any extra sequences
*/
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))
}
seq_setunseen(mp, 1); /* add new msgs to unseen sequences */
}
seq_setunseen(mp, 1); /* add new msgs to unseen sequences */
unlink(tmpfilenam); /* remove temporary file */
tmpfilenam = NULL;
unlink(tmpfilenam); /* remove temporary file */
tmpfilenam = NULL;
}
/*
** Clean up and exit
*/
static void
}
/*
** Clean up and exit
*/
static void
- if (tmpfilenam && *tmpfilenam)
+ if (tmpfilenam && *tmpfilenam) {
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [msgs] [switches] +folder ...", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [msgs] [switches] +folder ...", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
opnfolds(folders, foldp);
for (i = 0; i < filep; i++)
if (m_file(files[i], folders, foldp, 0))
opnfolds(folders, foldp);
for (i = 0; i < filep; i++)
if (m_file(files[i], folders, foldp, 0))
+ /* sysexits.h EX_IOERR */
+ exit(1);
/* If -nolink, then unlink files */
if (!linkf) {
int i;
/* If -nolink, then unlink files */
if (!linkf) {
int i;
admonish(files[i], "unable to unlink");
}
}
admonish(files[i], "unable to unlink");
}
}
/* parse the message range/sequence/name and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse the message range/sequence/name and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
+ /* sysexits.h EX_USAGE */
+ exit(1);
seq_setprev(mp); /* set the previous-sequence */
/* create folder structures for each destination folder */
seq_setprev(mp); /* set the previous-sequence */
/* create folder structures for each destination folder */
if (is_selected(mp, msgnum)) {
cp = getcpy(m_name(msgnum));
if (m_file(cp, folders, foldp, !linkf))
if (is_selected(mp, msgnum)) {
cp = getcpy(m_name(msgnum));
if (m_file(cp, folders, foldp, !linkf))
+ /* sysexits.h EX_IOERR */
+ exit(1);
context_replace(curfolder, folder);
context_save();
folder_free(mp);
context_replace(curfolder, folder);
context_save();
folder_free(mp);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s: [+folder] [msg] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s: [+folder] [msg] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case GROUPSW:
groupreply++;
case GROUPSW:
groupreply++;
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert(mp, msg))
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert(mp, msg))
+ /* sysexits.h EX_USAGE */
+ exit(1);
seq_setprev(mp); /* set the previous-sequence */
if (mp->numsel > 1)
seq_setprev(mp); /* set the previous-sequence */
if (mp->numsel > 1)
what_now(ed, NOUSE, drft, msg, 0, mp, anot ? "Replied" : NULL, cwd);
what_now(ed, NOUSE, drft, msg, 0, mp, anot ? "Replied" : NULL, cwd);
+ /* sysexits.h EX_SOFTWARE */
switch (smatch(cp, ccswitches)) {
case AMBIGSW:
ambigsw(cp, ccswitches);
switch (smatch(cp, ccswitches)) {
case AMBIGSW:
ambigsw(cp, ccswitches);
case UNKWNSW:
adios(NULL, "-%scc %s unknown", ccflag ? "" : "no", cp);
case UNKWNSW:
adios(NULL, "-%scc %s unknown", ccflag ? "" : "no", cp);
default:
if (pidXwait(pid, "mhl"))
default:
if (pidXwait(pid, "mhl"))
+ /* sysexits.h EX_SOFTWARE */
+ exit(1);
fseek(out, 0L, SEEK_END);
break;
}
fseek(out, 0L, SEEK_END);
break;
}
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case INTRSW:
interactive = 1;
case INTRSW:
interactive = 1;
if (interactive) {
cp = concat("Remove folder \"", folder, "\"? ", NULL);
if (!getanswer(cp))
if (interactive) {
cp = concat("Remove folder \"", folder, "\"? ", NULL);
if (!getanswer(cp))
}
}
context_save(); /* save the context file */
}
}
context_save(); /* save the context file */
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown\n", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case UNLINKSW:
unlink_msgs++;
case UNLINKSW:
unlink_msgs++;
*/
for (msgnum = 0; msgnum < msgs.size; msgnum++) {
if (!m_convert(mp, msgs.msgs[msgnum])) {
*/
for (msgnum = 0; msgnum < msgs.size; msgnum++) {
if (!m_convert(mp, msgs.msgs[msgnum])) {
+ /* sysexits EX_USAGE */
+ exit(1);
seq_setprev(mp);
seq_save(mp);
folder_free(mp);
seq_setprev(mp);
seq_save(mp);
folder_free(mp);
}
/* remove by refiling. */
}
/* remove by refiling. */
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
seq_setprev(mp); /* set the Previous-Sequence */
context_replace(curfolder, folder); /* update current folder */
seq_setprev(mp); /* set the Previous-Sequence */
context_replace(curfolder, folder); /* update current folder */
folder_free(mp); /* free folder/message structure */
folder_free(mp); /* free folder/message structure */
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] [address info sender]", invo_name);
print_help(buf, switches, 0);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] [address info sender]", invo_name);
print_help(buf, switches, 0);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case ADDRSW:
if (!(addr = *argp++)) {
case ADDRSW:
if (!(addr = *argp++)) {
/* deliver the message */
status = localmail(fd, mdlvr);
/* deliver the message */
status = localmail(fd, mdlvr);
- done(status != -1 ? RCV_MOK : RCV_MBX);
- return 1;
+ return (status != -1 ? RCV_MOK : RCV_MBX);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert(mp, msgs.msgs[msgnum]))
seq_setprev(mp); /* set the previous sequence */
if ((nmsgs = read_hdrs(mp, datesw)) <= 0)
seq_setprev(mp); /* set the previous sequence */
if ((nmsgs = read_hdrs(mp, datesw)) <= 0)
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s [switches] file",
invo_name);
print_help(buf, switches, 1);
"%s [switches] file",
invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
if (debug) {
/* stop here */
if (debug) {
/* stop here */
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s [switches] [file]",
invo_name);
print_help(buf, switches, 1);
"%s [switches] [file]",
invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
unlink(drft);
}
advise(NULL, "Try again.");
unlink(drft);
}
advise(NULL, "Try again.");
+ /* sysexits.h EX_SOFTWARE */
+ exit(1);
}
}
snprintf(prompt, sizeof(prompt), myprompt, invo_name);
for (;;) {
if (!(argp = getans(prompt, aleqs))) {
}
}
snprintf(prompt, sizeof(prompt), myprompt, invo_name);
for (;;) {
if (!(argp = getans(prompt, aleqs))) {
}
switch (smatch(*argp, aleqs)) {
case DISPSW:
}
switch (smatch(*argp, aleqs)) {
case DISPSW:
if (stat(drft, &st) != NOTOK) {
advise(NULL, "draft left on %s", drft);
}
if (stat(drft, &st) != NOTOK) {
advise(NULL, "draft left on %s", drft);
}
case DELETESW:
/* Delete draft and exit */
removefile(drft);
case DELETESW:
/* Delete draft and exit */
removefile(drft);
case SENDSW:
/* Send draft */
case SENDSW:
/* Send draft */
case REFILEOPT:
/* Refile the draft */
if (refile(++argp, drft) == 0) {
case REFILEOPT:
/* Refile the draft */
if (refile(++argp, drft) == 0) {
default:
if (pidwait(child_id, OK) == 0)
default:
if (pidwait(child_id, OK) == 0)
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
case UNKWNSW:
adios(NULL, "-%s unknown", cp);
"%s [switches] file ...",
invo_name);
print_help(buf, switches, 1);
"%s [switches] file ...",
invo_name);
print_help(buf, switches, 1);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);