Replace done with exit at uip
[mmh] / uip / prompter.c
index e1f0bff..03038a6 100644 (file)
@@ -57,9 +57,7 @@ main(int argc, char **argv)
        FILE *in, *out;
        char *tfile = NULL;
 
-#ifdef LOCALE
        setlocale(LC_ALL, "");
-#endif
        invo_name = mhbasename(argv[0]);
 
        /* read user profile/context */
@@ -73,7 +71,7 @@ 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);
 
@@ -82,10 +80,10 @@ main(int argc, char **argv)
                                                "%s [switches] file",
                                                invo_name);
                                print_help(buffer, switches, 1);
-                               done(1);
+                               exit(0);
                        case VERSIONSW:
                                print_version(invo_name);
-                               done(1);
+                               exit(0);
 
                        case PREPSW:
                                prepend++;
@@ -162,7 +160,8 @@ main(int argc, char **argv)
                                if (i == -1) {
 abort:
                                        unlink(tmpfil);
-                                       done(1);
+                                       /* sysexits.h EX_DATAERR */
+                                       exit(1);
                                }
                                if (i || (field[0]!='\n' && field[0]!='\0')) {
                                        fprintf(out, "%s:", name);
@@ -256,8 +255,7 @@ has_no_body:
        unlink(tmpfil);
 
        context_save();  /* save the context file */
-       done(0);
-       return 1;
+       return 0;
 }