]> diplodocus.org Git - nmh/commitdiff
Remove the --disable-locale configure option and make locale support
authorKen Hornstein <kenh@pobox.com>
Mon, 20 Jan 2014 04:21:32 +0000 (23:21 -0500)
committerKen Hornstein <kenh@pobox.com>
Mon, 20 Jan 2014 04:21:32 +0000 (23:21 -0500)
unconditional.

55 files changed:
configure.ac
sbr/fmt_compile.c
sbr/fmt_scan.c
sbr/gans.c
sbr/m_atoi.c
sbr/m_convert.c
sbr/uprf.c
uip/ali.c
uip/anno.c
uip/ap.c
uip/burst.c
uip/comp.c
uip/conflict.c
uip/dist.c
uip/dp.c
uip/flist.c
uip/fmtdump.c
uip/fmttest.c
uip/folder.c
uip/forw.c
uip/inc.c
uip/install-mh.c
uip/mark.c
uip/mhbuild.c
uip/mhfixmsg.c
uip/mhl.c
uip/mhlist.c
uip/mhn.c
uip/mhpath.c
uip/mhshow.c
uip/mhstore.c
uip/mhtest.c
uip/msgchk.c
uip/msh.c
uip/new.c
uip/packf.c
uip/pick.c
uip/post.c
uip/prompter.c
uip/rcvdist.c
uip/rcvpack.c
uip/rcvstore.c
uip/rcvtty.c
uip/refile.c
uip/repl.c
uip/rmf.c
uip/rmm.c
uip/scan.c
uip/send.c
uip/show.c
uip/slocal.c
uip/sortm.c
uip/viamail.c
uip/whatnow.c
uip/whom.c

index 61a8beb..35fc781 100644 (file)
@@ -28,14 +28,6 @@ dnl Do you want to debug nmh?
 AC_ARG_ENABLE([debug],
   AS_HELP_STRING([--enable-debug],[enable nmh code debugging]))
 
-dnl Do you want to disable use of locale functions
-AH_TEMPLATE([LOCALE],
-[Undefine if you don't want locale features.  By default this is defined.])
-AC_ARG_ENABLE([locale],
-  [AS_HELP_STRING([--disable-locale], [turn off locale features])],
-  [AS_IF([test x$enableval = xyes], [AC_DEFINE(LOCALE)])],
-  [AC_DEFINE(LOCALE)])
-
 dnl Do you want client-side support for using SASL for authentication?
 dnl Note that this code will be enabled for both POP and SMTP
 AC_ARG_WITH([cyrus-sasl], AS_HELP_STRING([--with-cyrus-sasl],
index 75adc08..970e71e 100644 (file)
@@ -364,11 +364,7 @@ compile_error(char *str, char *cp)
     usr_fstring[errpos] = '\0';
 
     for (i = errpos-errctx; i < errpos; i++) {
-#ifdef LOCALE
        if (iscntrl((unsigned char) usr_fstring[i]))
-#else
-       if (usr_fstring[i] < 32)
-#endif
            usr_fstring[i] = '_';
     }
 
index 9b84861..e4d79d5 100644 (file)
@@ -47,7 +47,6 @@ match (char *str, char *sub)
     int c1, c2;
     char *s1, *s2;
 
-#ifdef LOCALE
     while ((c1 = *sub)) {
        c1 = (isascii((unsigned char) c1) && isalpha((unsigned char) c1) &&
              isupper((unsigned char) c1)) ? tolower((unsigned char) c1) : c1;
@@ -71,19 +70,6 @@ match (char *str, char *sub)
        if (! c1)
            return 1;
     }
-#else
-    while ((c1 = *sub)) {
-       while ((c2 = *str++) && (c1 | 040) != (c2 | 040))
-           ;
-       if (! c2)
-           return 0;
-       s1 = sub + 1; s2 = str;
-       while ((c1 = *s1++) && (c1 | 040) == (*s2++ | 040))
-           ;
-       if (! c1)
-           return 1;
-    }
-#endif
     return 1;
 }
 
index 6b76b7b..7023402 100644 (file)
@@ -26,12 +26,7 @@ gans (char *prompt, struct swit *ansp)
            if (i == EOF)
                return 0;
            if (cp < &ansbuf[sizeof ansbuf - 1]) {
-#ifdef LOCALE
                i = (isalpha(i) && isupper(i)) ? tolower(i) : i;
-#else
-               if (i >= 'A' && i <= 'Z')
-                   i += 'a' - 'A';
-#endif
                *cp++ = i;
            }
        }
index f05271f..da6730d 100644 (file)
@@ -19,11 +19,7 @@ m_atoi (char *str)
     char *cp;
 
     for (i = 0, cp = str; *cp; cp++) {
-#ifdef LOCALE
        if (!isdigit((unsigned char) *cp))
-#else
-       if (*cp < '0' || *cp > '9')
-#endif
            return 0;
 
        i *= 10;
index 62268fb..d708006 100644 (file)
@@ -286,14 +286,9 @@ m_conv (struct msgs *mp, char *str, int call)
            return BADNUM;
     }
 
-#ifdef LOCALE
     /* doesn't enforce lower case */
     for (bp = buf; (isalpha((unsigned char) *cp) || *cp == '.')
            && (bp - buf < (int) sizeof(buf) - 1); )
-#else
-    for (bp = buf; ((*cp >= 'a' && *cp <= 'z') || *cp == '.')
-           && (bp - buf < (int) sizeof(buf) - 1); )
-#endif /* LOCALE */
     {
        *bp++ = *cp++;
     }
index 5da5e76..500b036 100644 (file)
@@ -9,11 +9,6 @@
 
 #include <h/mh.h>
 
-#ifndef LOCALE
-# define TO_LOWER 040
-# define NO_MASK  000
-#endif
-
 
 int
 uprf (char *c1, char *c2)
@@ -25,16 +20,11 @@ uprf (char *c1, char *c2)
 
     while ((c = *c2++))
     {
-#ifdef LOCALE
        c &= 0xff;
        mask = *c1 & 0xff;
        c = (isalpha(c) && isupper(c)) ? tolower(c) : c;
        mask = (isalpha(mask) && isupper(mask)) ? tolower(mask) : mask;
        if (c != mask)
-#else
-       mask = (isalpha(c) && isalpha(*c1)) ?  TO_LOWER : NO_MASK;
-       if ((c | mask) != (*c1 | mask))
-#endif
            return 0;
        else
            c1++;
index dda0a2c..534c25d 100644 (file)
--- a/uip/ali.c
+++ b/uip/ali.c
@@ -53,9 +53,7 @@ main (int argc, char **argv)
     char **vec = mh_xmalloc (argc * sizeof (char *)), **arguments;
     struct aka *ak;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index d18713a..75bcc68 100644 (file)
@@ -94,9 +94,7 @@ main (int argc, char **argv)
     int                list = 0;               /* list header elements if set */
     int                number = 0;             /* delete specific number of like elements if set */
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index f0b0baa..a8f9169 100644 (file)
--- a/uip/ap.c
+++ b/uip/ap.c
@@ -53,9 +53,7 @@ main (int argc, char **argv)
     char buf[BUFSIZ], **argp;
     char **arguments, *addrs[NADDRS];
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 34ef10b..e838422 100644 (file)
@@ -75,9 +75,7 @@ main (int argc, char **argv)
     struct smsg *smsgs;
     struct msgs *mp;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 0850729..a7300c3 100644 (file)
@@ -83,9 +83,7 @@ main (int argc, char **argv)
     struct format *fmt;
     struct stat st;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index a43c70e..9174a39 100644 (file)
@@ -68,9 +68,7 @@ main (int argc, char **argv)
     char *cp, **argp, **arguments;
     char buf[BUFSIZ], *akv[50];
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* foil search of user profile/context */
index d3ceaec..00503be 100644 (file)
@@ -83,9 +83,7 @@ main (int argc, char **argv)
     struct msgs *mp = NULL;
     struct stat st;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 67eef06..8245f60 100644 (file)
--- a/uip/dp.c
+++ b/uip/dp.c
@@ -51,9 +51,7 @@ main (int argc, char **argv)
     char buf[BUFSIZ], **argp, **arguments;
     char *dates[NDATES];
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index fe3dceb..cea1ca7 100644 (file)
@@ -115,9 +115,7 @@ main(int argc, char **argv)
     char **arguments;
     char buf[BUFSIZ];
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex(argv[0], '/');
 
     /* read user profile/context */
index 6535816..289f1e6 100644 (file)
@@ -51,9 +51,7 @@ main (int argc, char **argv)
     char buf[BUFSIZ], *nfs, **argp, **arguments;
     struct format *fmt;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index b39d0d5..a3a436f 100644 (file)
@@ -121,9 +121,7 @@ main (int argc, char **argv)
     int dat[5];
     struct fmt_callbacks cb, *cbp = NULL;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 9fa2984..a2e6a4a 100644 (file)
@@ -101,9 +101,7 @@ main (int argc, char **argv)
     char *cp, *dp, *msg = NULL, *argfolder = NULL;
     char **ap, **argp, buf[BUFSIZ], **arguments;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 45fb740..9eeb612 100644 (file)
@@ -119,9 +119,7 @@ main (int argc, char **argv)
 
     int buildsw = 0;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 0e52744..3aa5e50 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -197,9 +197,7 @@ main (int argc, char **argv)
     SAVEGROUPPRIVS();
     TRYDROPGROUPPRIVS();
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 2921d26..0fc97c4 100644 (file)
@@ -42,9 +42,7 @@ main (int argc, char **argv)
     FILE *in, *out;
     int                check;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
     arguments = getarguments (invo_name, argc, argv, 0);
     argp = arguments;
index f0f3d7a..439ea40 100644 (file)
@@ -52,9 +52,7 @@ main (int argc, char **argv)
     struct msgs_array msgs = { 0, 0, NULL };
     struct msgs *mp;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 18844b5..0af3c56 100644 (file)
@@ -115,9 +115,7 @@ main (int argc, char **argv)
 
     done=unlink_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index fd77769..bafd78e 100644 (file)
@@ -137,9 +137,7 @@ main (int argc, char **argv) {
 
     done = freects_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index af4cdfa..d4c5308 100644 (file)
--- a/uip/mhl.c
+++ b/uip/mhl.c
@@ -13,9 +13,7 @@
 int
 main (int argc, char **argv)
 {
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     done (mhl (argc, argv));
     return 1;
 }
index f6208dd..7092434 100644 (file)
@@ -109,9 +109,7 @@ main (int argc, char **argv)
 
     done=freects_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index b2db307..06aeee5 100644 (file)
--- a/uip/mhn.c
+++ b/uip/mhn.c
@@ -169,9 +169,7 @@ main (int argc, char **argv)
 
     done=freects_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 3a0a628..29b59f4 100644 (file)
@@ -32,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 = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 94e5e06..f19f9a9 100644 (file)
@@ -119,9 +119,7 @@ main (int argc, char **argv)
 
     done=freects_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 79f335e..fff480a 100644 (file)
@@ -108,9 +108,7 @@ main (int argc, char **argv)
 
     done=freects_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 49d2a98..092b542 100644 (file)
@@ -104,9 +104,7 @@ main (int argc, char **argv)
 
     done=freects_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 76bb37d..39a2918 100644 (file)
@@ -85,9 +85,7 @@ main (int argc, char **argv)
     char **argp, **arguments, *vec[MAXVEC];
     struct passwd *pw;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 2fb2b23..75371ba 100644 (file)
--- a/uip/msh.c
+++ b/uip/msh.c
@@ -203,9 +203,7 @@ main (int argc, char **argv)
     char *cp, *file = NULL, *folder = NULL;
     char **argp, **arguments, buf[BUFSIZ];
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 74d4d51..59b5b8c 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
@@ -422,9 +422,7 @@ main(int argc, char **argv)
     char *unseen;
     struct node *folder;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex(argv[0], '/');
 
     /* read user profile/context */
index f070f48..6f95191 100644 (file)
@@ -48,9 +48,7 @@ main (int argc, char **argv)
 
     done=mbxclose_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 5f28024..a915920 100644 (file)
@@ -68,9 +68,7 @@ main (int argc, char **argv)
 
     done=putzero_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 8589463..f6e14fb 100644 (file)
@@ -283,9 +283,7 @@ main (int argc, char **argv)
     FILE *in, *out;
     m_getfld_state_t gstate = 0;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* foil search of user profile/context */
index afa81f5..7923e84 100644 (file)
@@ -78,9 +78,7 @@ main (int argc, char **argv)
     char *tmpfil;
     m_getfld_state_t gstate = 0;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 6cc8e27..8b672cd 100644 (file)
@@ -50,9 +50,7 @@ main (int argc, char **argv)
 
     done=unlink_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 4725f26..08e21b9 100644 (file)
@@ -40,9 +40,7 @@ main (int argc, char **argv)
     char *cp, *file = NULL, buf[BUFSIZ];
     char **argp, **arguments;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 2822093..98f1750 100644 (file)
@@ -56,9 +56,7 @@ main (int argc, char **argv)
 
     done=unlink_done;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 356234a..447c6e4 100644 (file)
@@ -81,9 +81,8 @@ main (int argc, char **argv)
     char *cp, *user, buf[BUFSIZ], tty[BUFSIZ];
     char **argp, **arguments, *vec[MAXARGS];
     struct utmpx *utp;
-#ifdef LOCALE
+
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 19e1266..776c6fd 100644 (file)
@@ -68,9 +68,7 @@ main (int argc, char **argv)
     struct msgs_array msgs = { 0, 0, NULL };
     struct msgs *mp;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 8437456..d1c8ebf 100644 (file)
@@ -129,9 +129,7 @@ main (int argc, char **argv)
 
     int buildsw = 0;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 9e92247..735cf77 100644 (file)
--- a/uip/rmf.c
+++ b/uip/rmf.c
@@ -37,9 +37,7 @@ main (int argc, char **argv)
     char *cp, *folder = NULL, newfolder[BUFSIZ];
     char buf[BUFSIZ], **argp, **arguments;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index ee602b4..8882b8f 100644 (file)
--- a/uip/rmm.c
+++ b/uip/rmm.c
@@ -37,9 +37,7 @@ main (int argc, char **argv)
     struct msgs_array msgs = { 0, 0, NULL };
     struct msgs *mp;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 1f487cd..3130922 100644 (file)
@@ -52,9 +52,7 @@ main (int argc, char **argv)
     struct msgs *mp;
     FILE *in;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index e7ca715..be5dc79 100644 (file)
@@ -120,9 +120,7 @@ main (int argc, char **argv)
     char *attach = NMH_ATTACH_HEADER;  /* header field name for attachments */
     int attachformat = 1; /* mhbuild format specifier for attachments */
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 5a912f6..14d4191 100644 (file)
@@ -61,9 +61,7 @@ main (int argc, char **argv)
     struct msgs_array msgs = { 0, 0, NULL };
     struct msgs_array vec = { 0, 0, NULL };
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 8daf608..8dace05 100644 (file)
@@ -188,9 +188,7 @@ main (int argc, char **argv)
     char mailbox[BUFSIZ], tmpfil[BUFSIZ];
     char **argp, **arguments;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (*argv, '/');
 
     /* foil search of user profile/context */
index 72fe065..f6a66f1 100644 (file)
@@ -78,9 +78,7 @@ main (int argc, char **argv)
     struct smsg **dlist;
     int checksw = 0;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */
index 7c81079..39ccf50 100644 (file)
@@ -58,9 +58,7 @@ main (int argc, char **argv)
     char *cp, buf[BUFSIZ];
     char **argp, **arguments;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* foil search of user profile/context */
index be50bc9..4950514 100644 (file)
@@ -13,8 +13,6 @@
 int
 main (int argc, char **argv)
 {
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     return WhatNow (argc, argv);
 }
index eca3946..8973c76 100644 (file)
@@ -63,9 +63,7 @@ main (int argc, char **argv)
     char *msg = NULL, **ap, **argp, backup[BUFSIZ];
     char buf[BUFSIZ], **arguments, *vec[MAXARGS];
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     /* read user profile/context */