#include <h/mh.h>
#include <h/tws.h>
#include <h/utils.h>
+#include <unistd.h>
+#include <locale.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
static int listsw = -1;
-static void putzero_done();
+void putzero_done();
int
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]);
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;
folder);
if (!pcompile(vec, NULL))
- /* sysexits.h EX_USAGE */
exit(1);
lo = mp->lowsel;
*/
for (seqp = 0; seqs[seqp]; seqp++)
if (!seq_addsel(mp, seqs[seqp], publicsw, zerosw))
- /* sysexits.h EX_IOERR */
exit(1);
/*
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");
- }
}