Removed configure flag --disable-locale and have it always enabled.
[mmh] / uip / send.c
index ed4aca0..bcbd54d 100644 (file)
@@ -42,7 +42,7 @@ static FILE *composition_file;  /* composition file pointer */
 /*
 ** static prototypes
 */
-static int sendsbr(char **, int, char *, struct stat *, int);
+static int sendsbr(char **, int, char *, struct stat *);
 static void armed_done(int) NORETURN;
 static void anno(struct stat *);
 static int sendaux(char **, int, char *, struct stat *);
@@ -60,13 +60,13 @@ static struct swit switches[] = {
 #define VERBSW  2
        { "verbose", 0 },
 #define NVERBSW  3
-       { "noverbose", 0 },
+       { "noverbose", 2 },
 #define WATCSW  4
        { "watch", 0 },
 #define NWATCSW  5
-       { "nowatch", 0 },
+       { "nowatch", 2 },
 #define VERSIONSW  6
-       { "version", 0 },
+       { "Version", 0 },
 #define HELPSW  7
        { "help", 0 },
        { NULL, 0 }
@@ -88,10 +88,7 @@ main(int argc, char **argv)
        struct stat st;
        struct stat st2;
 
-
-#ifdef LOCALE
        setlocale(LC_ALL, "");
-#endif
        invo_name = mhbasename(argv[0]);
 
        /* read user profile/context */
@@ -248,7 +245,7 @@ main(int argc, char **argv)
        }
 
        for (msgnum = 0; msgnum < nfiles; msgnum++) {
-               switch (sendsbr(vec, vecp, files[msgnum], &st, 1)) {
+               switch (sendsbr(vec, vecp, files[msgnum], &st)) {
                case DONE:
                        done(++status);
                case NOTOK:
@@ -268,7 +265,7 @@ main(int argc, char **argv)
 ** message sending back-end
 */
 static int
-sendsbr(char **vec, int vecp, char *drft, struct stat *st, int rename_drft)
+sendsbr(char **vec, int vecp, char *drft, struct stat *st)
 {
        int status;
        char buffer[BUFSIZ];
@@ -308,11 +305,12 @@ sendsbr(char **vec, int vecp, char *drft, struct stat *st, int rename_drft)
        case OK:
                status = sendaux(vec, vecp, drft, st) ? NOTOK : OK;
                /* rename the original draft */
-               if (rename_drft && status == OK &&
-                               rename(original_draft, strncpy(buffer,
-                               m_backup(original_draft), sizeof(buffer)))
-                               == NOTOK) {
-                       advise(buffer, "unable to rename %s to", drft);
+               if (status == OK) {
+                       strncpy(buffer, m_backup(original_draft),
+                                       sizeof(buffer));
+                       if (rename(original_draft, buffer) == NOTOK) {
+                               advise(buffer, "unable to rename %s to", drft);
+                       }
                }
                break;