X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fpick.c;h=07dca9a98b342930cd5f67e16ab308f78518616b;hp=7c42b42af9d744e7ec92fad3a68b5bf6844b19f9;hb=2abb9a7cfb0930e27062088734d306e7d78e4cc2;hpb=fede6e42d81ce34fd5c1bbe7fb2757b281c2573a diff --git a/uip/pick.c b/uip/pick.c index 7c42b42..07dca9a 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #ifdef HAVE_SYS_TIME_H # include @@ -76,7 +78,7 @@ static int pmatches(FILE *, int, long, long); static int listsw = -1; -static void putzero_done(); +void putzero_done(); int main(int argc, char **argv) @@ -91,7 +93,9 @@ main(int argc, char **argv) struct msgs *mp; register FILE *fp; - atexit(putzero_done); + if (atexit(putzero_done) != 0) { + adios(NULL, "atexit failed"); + } setlocale(LC_ALL, ""); invo_name = mhbasename(argv[0]); @@ -163,8 +167,7 @@ main(int argc, char **argv) adios(NULL, "too many sequences (more than %d) specified", NUMATTRS); if (!seq_nameok(cp)) - /* sysexits.h EX_USAGE */ - exit(1); + exit(1); seqs[seqp++] = cp; continue; @@ -239,7 +242,6 @@ main(int argc, char **argv) folder); if (!pcompile(vec, NULL)) - /* sysexits.h EX_USAGE */ exit(1); lo = mp->lowsel; @@ -291,7 +293,6 @@ main(int argc, char **argv) */ for (seqp = 0; seqs[seqp]; seqp++) if (!seq_addsel(mp, seqs[seqp], publicsw, zerosw)) - /* sysexits.h EX_IOERR */ exit(1); /* @@ -305,16 +306,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 */ + listsw = 0; /* HACK */ return 0; } -static void +void putzero_done() { - if (listsw && !isatty(fileno(stdout))) { + if (listsw && !isatty(fileno(stdout))) printf("0\n"); - } }