X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fpick.c;h=6c59add7630f4d85d4483f03dfc26a201a9b2b9a;hp=58c5969ce1900b25c06ca7c56e6d739333e9cf0b;hb=5a12e4b0477d3ad699f5713682d26079f2792d17;hpb=f9ed40f2742263b3a1023bedee4139b4b18f0a86 diff --git a/uip/pick.c b/uip/pick.c index 58c5969..6c59add 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -76,7 +76,7 @@ static int pmatches(FILE *, int, long, long); static int listsw = -1; -static void putzero_done(int) NORETURN; +static void putzero_done(); int main(int argc, char **argv) @@ -91,7 +91,7 @@ main(int argc, char **argv) struct msgs *mp; register FILE *fp; - done=putzero_done; + atexit(putzero_done); setlocale(LC_ALL, ""); invo_name = mhbasename(argv[0]); @@ -112,7 +112,7 @@ main(int argc, char **argv) case AMBIGSW: ambigsw(cp, switches); listsw = 0; /* HACK */ - done(1); + exit(1); case UNKWNSW: adios(NULL, "-%s unknown", cp); @@ -120,11 +120,11 @@ main(int argc, char **argv) snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help(buf, switches, 1); listsw = 0; /* HACK */ - done(1); + exit(0); case VERSIONSW: print_version(invo_name); listsw = 0; /* HACK */ - done(1); + exit(0); case CCSW: case DATESW: @@ -163,7 +163,7 @@ main(int argc, char **argv) adios(NULL, "too many sequences (more than %d) specified", NUMATTRS); if (!seq_nameok(cp)) - done(1); + exit(1); seqs[seqp++] = cp; continue; @@ -223,7 +223,7 @@ main(int argc, char **argv) /* 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); + exit(1); seq_setprev(mp); /* set the previous-sequence */ /* @@ -238,7 +238,7 @@ main(int argc, char **argv) folder); if (!pcompile(vec, NULL)) - done(1); + exit(1); lo = mp->lowsel; hi = mp->hghsel; @@ -289,7 +289,7 @@ main(int argc, char **argv) */ for (seqp = 0; seqs[seqp]; seqp++) if (!seq_addsel(mp, seqs[seqp], publicsw, zerosw)) - done(1); + exit(1); /* ** Print total matched if not printing each matched message number. @@ -302,17 +302,16 @@ main(int argc, char **argv) seq_save(mp); /* synchronize message sequences */ context_save(); /* save the context file */ folder_free(mp); /* free folder/message structure */ - done(0); - return 1; + listsw = 0; /* HACK */ + return 0; } static void -putzero_done(int status) +putzero_done() { - if (listsw && status && !isatty(fileno(stdout))) + if (listsw && !isatty(fileno(stdout))) printf("0\n"); - exit(status); }