Move #include from h/mh.h to source files
[mmh] / uip / packf.c
index b565c16..78f64c0 100644 (file)
@@ -11,6 +11,8 @@
 #include <h/dropsbr.h>
 #include <h/utils.h>
 #include <errno.h>
+#include <unistd.h>
+#include <locale.h>
 
 static struct swit switches[] = {
 #define VERSIONSW  0
@@ -30,9 +32,7 @@ main(int argc, char **argv)
        struct msgs_array msgs = { 0, 0, NULL };
        struct msgs *mp;
 
-#ifdef LOCALE
        setlocale(LC_ALL, "");
-#endif
        invo_name = mhbasename(argv[0]);
 
        /* read user profile/context */
@@ -49,17 +49,17 @@ main(int argc, char **argv)
                        switch (smatch(++cp, switches)) {
                        case AMBIGSW:
                                ambigsw(cp, switches);
-                               done(1);
+                               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);
-                               done(1);
+                               exit(0);
                        case VERSIONSW:
                                print_version(invo_name);
-                               done(1);
+                               exit(0);
                        }
                }
                if (*cp == '+' || *cp == '@') {
@@ -92,7 +92,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 */
 
        /* copy all the SELECTED messages to stdout */
@@ -115,6 +115,5 @@ main(int argc, char **argv)
        seq_save(mp);
        context_save();
        folder_free(mp);
-       done(0);
-       return 1;
+       return 0;
 }