]> diplodocus.org Git - nmh/commitdiff
Merge branch 'mhbuild-always'
authorKen Hornstein <kenh@pobox.com>
Thu, 23 Jan 2014 18:35:31 +0000 (13:35 -0500)
committerKen Hornstein <kenh@pobox.com>
Thu, 23 Jan 2014 18:35:31 +0000 (13:35 -0500)
70 files changed:
MACHINES
configure.ac
docs/contrib/build_nmh
docs/contrib/ml
docs/pending-release-notes
man/mh-profile.man
man/mhbuild.man
man/mhpath.man
man/mhshow.man
man/scan.man
man/show.man
sbr/check_charset.c
sbr/encode_rfc2047.c
sbr/fmt_compile.c
sbr/fmt_scan.c
sbr/gans.c
sbr/m_atoi.c
sbr/m_convert.c
sbr/uprf.c
test/common.sh.in
test/pick/test-pick
test/scan/test-scan-multibyte
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 216a6ab..d184287 100644 (file)
--- a/MACHINES
+++ b/MACHINES
 # MACHINES -- operating system specific information
 #
 
-nmh is known to compile on the following platforms (save the
-exceptions noted below), using an ANSI C compiler, such as gcc.
-
-AIX 4.1.5.0.01
-Cygwin (setup version 2.831, other versions may be fine)
-FreeBSD
-IRIX 6.5
-Linux 2.2 to current (glibc 2.1 to current)
-Mac OS X
-NetBSD 1.4.2
-OpenBSD
-Solaris 7 and 8 (sparc,x86)
-SunOS 4.1
-
-Known Compilation problems:
---------------------------------------
-Cygwin:
-
-Be sure to install these Cygwin packages (or later versions):
-  libdb4.8
-  libdb4.8-devel
-  libgdbm-devel
-  libncurses-devel
-
-Some versions of libncurses-devel do not install /usr/include/curses.h,
-/usr/include/term.h, and /usr/include/termcap.h.  If yours does not,
-add /usr/include/ symlinks to those files in /usr/include/ncurses/.
-
-The database packages are only used by slocal(1).
-
-If configuring with --with-cyrus-sasl, install these Cygwin packages:
-  libsasl2
-  libsasl2-devel
-
-If configuring with --with-tls, install this Cygwin package (or a
-later version):
-  libgnutls28
-
-When running the nmh test suite ("make check"), it helps to have
-/usr/bin/ ahead of any Windows directories on your PATH.
-
-Note that the -link switch to refile cannot be used on FAT32 and
-similar filesystems.
-
---------------------------------------
-HPUX:
+nmh is routinely built and tested on recent versions of the following
+platforms:
+    Cygwin (32- and 64-bit)
+    FreeBSD 9
+    FreeBSD 10
+    Linux (Fedora and Ubuntu distributions)
+    Mac OS X
+    OpenBSD
+    Solaris 11
+
+nmh was known in the distant past to compile on the following platforms (save
+the exceptions noted below), using an ANSI C compiler, such as gcc:
+    AIX 4.1.5.0.01
+    IRIX 6.5
+    NetBSD 1.4.2
+    Solaris 7 and 8 (sparc,x86)
+    SunOS 4.1
+
+Platform-specific notes follow.
+
+------------------------------------------------------------------------------
+                                    Linux
+------------------------------------------------------------------------------
+
+Run-time package requirements:
+    ncurses-libs
+    libdb (only needed for slocal(1))
+    readline (if you want readline support)
+    cyrus-sasl-lib / libsasl2 (if configured with --with-cyrus-sasl)
+    openssl-libs / libssl (if configured with --with-tls)
+
+Additional build-time package requirements:
+    flex
+    ncurses-devel / libncurses5-devel
+    libdb-devel / libdb-dev (only needed for slocal(1))
+    readline-devel (if you want readline support)
+    cyrus-sasl-devel / libsasl2-dev (if configuring with --with-cyrus-sasl)
+    openssl-devel / libssl-dev (if configuring with --with-tls)
+
+Packages required to regenerate the configure script:
+    autoconf
+    automake
+
+------------------------------------------------------------------------------
+                                    Cygwin
+------------------------------------------------------------------------------
+
+Run-time package requirements:
+    file
+    libncurses10 or libncursesw10
+    libgdbm4 (only needed for slocal(1))
+    libiconv or libiconv2 (if you want iconv support)
+    libreadline7 (if you want readline support)
+    libsasl2_3 (if configured with --with-cyrus-sasl)
+    openssl (if configured with --with-tls)
+
+Additional build-time package requirements:
+    flex
+    libncurses-devel or libncursesw-devel
+    libgdbm4-devel (only needed for slocal(1))
+    libiconv-devel (if you want iconv support)
+    libreadline-devel (if you want readline support)
+    libsasl2-devel (if configuring with --with-cyrus-sasl)
+    openssl-devel (if configuring with --with-tls)
+
+    Older versions of libncurses-devel do not install /usr/include/curses.h,
+    /usr/include/term.h, and /usr/include/termcap.h.  If yours does not,
+    either add symlinks in /usr/include/ to those files in its ncurses/
+    subdirectory, or build with:
+        make DEFAULT_INCLUDES='-I. -I/usr/include/ncurses'
+
+Packages required to regenerate the configure script:
+    autoconf
+    automake
+
+When running the nmh test suite ("make check"), it helps to have /usr/bin/
+ahead of any Windows directories on your PATH.
+
+Note that the -link switch to refile cannot be used on FAT32 and similar
+filesystems.
+
+------------------------------------------------------------------------------
+                                     HPUX
+------------------------------------------------------------------------------
 
 Lots of problems have been reported with using HPUX `cc'.  In particular,
-problems with `scan' giving incorrect dates (everything is 01/00).
-It is highly recommended that you use `gcc' instead.
+problems with `scan' giving incorrect dates (everything is 01/00).  It is
+highly recommended that you use `gcc' instead.
 
-Also, new versions of HPUX (10.20?) will core dump in `scan' because
-of some workaround code in zotnet/tws/lexstring.c.  This workaround is
-needed for older versions of HPUX, but causes problems on newer versions.
-The solution is the added line (minus our indentation):
-
-    #undef hpux
-
-after line 15 of the file zotnet/tws/lexstring.c.
-
---------------------------------------
-Irix (SGI):
+------------------------------------------------------------------------------
+                                  Irix (SGI)
+------------------------------------------------------------------------------
 
 Irix make is notoriously buggy. If you're using it, you should "touch
-config.h.in" before configuring to prevent a problem where it tries to
-rebuild targets that shouldn't be rebuilt. (Alternately, you can just
-use GNU make instead of Irix make.)
-
---------------------------------------
-Linux:
-
-These packages are required at runtime:
-  ncurses-libs
-  libdb (only for slocal(1))
-  cyrus-sasl-lib (if configured with --with-cyrus-sasl)
-  gnutls (if configured with --with-tls)
-
-For building, these packages are required:
-  ncurses-devel
-  libdb-devel (only for slocal(1))
-  gdbm-devel (only for slocal(1))
-
-If configuring with --with-cyrus-sasl, install these packages:
-  cyrus-sasl-lib-devel
-
---------------------------------------
-Solaris:
-
-With --enable-debug you'll see a lot of warnings. This is even worse
-when compiling using the Sun Workshop compiler since it issues a
-warning for every instance of a problem instead of summarizing them.
-The main one concerns arrays with an index of type char. This is ok.
-The array itself is a hash of chars, so the array size and the type
-match. There isn't another safe and portable way to do this at the
-moment. An explicit cast would get rid of the warnings, but I think
-it's better to leave it complaining for now until we come up with
-a better solution. The whole thing is probablly going to be chucked
-with UTF-8 support anyway.
-
-Other than the warnings, it builds ok.
+config.h.in" before configuring to prevent a problem where it tries to rebuild
+targets that shouldn't be rebuilt. (Alternately, you can just use GNU make
+instead of Irix make.)
 
---------------------------------------
-SunOS 4.1.1/4.1.3/4.1.4:
+------------------------------------------------------------------------------
+                           SunOS 4.1.1/4.1.3/4.1.4
+------------------------------------------------------------------------------
 
-You can't use the C compiler that comes with SunOS 4 since
-it isn't ANSI C.  But nmh builds just fine with gcc. With
---enable-debug you will see a lot of warnings.
+You can't use the C compiler that comes with SunOS 4 since it isn't ANSI C.
+But nmh builds just fine with gcc.
 
---------------------------------------
+------------------------------------------------------------------------------
 
---
+----------
 The nmh team
 nmh-workers@nongnu.org
index 61a8beb..35118f3 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],
@@ -337,8 +329,7 @@ AS_CASE(["$host_os"],
                 [CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"])])
 
 AC_HEADER_TIOCGWINSZ
-AC_CHECK_HEADERS([fcntl.h langinfo.h wchar.h wctype.h sys/param.h \
-                 sys/time.h sys/stream.h])
+AC_CHECK_HEADERS([fcntl.h wchar.h wctype.h sys/param.h sys/time.h sys/stream.h])
 
 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1,
   [Define to 1 if `struct winsize' requires <sys/ptem.h>.]),,
@@ -350,7 +341,7 @@ AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1,
 dnl ---------------
 dnl CHECK FUNCTIONS
 dnl ---------------
-AC_CHECK_FUNCS([wcwidth mbtowc nl_langinfo getutxent arc4random])
+AC_CHECK_FUNCS([wcwidth mbtowc getutxent arc4random])
 
 dnl Check for multibyte character set support
 AS_IF([test "x$ac_cv_header_wchar_h" = "xyes" -a \
index 66383ac..ba421bf 100755 (executable)
@@ -223,7 +223,7 @@ config_opts="--prefix=$config_prefix"
 [ "$config_tls" = y ]  &&  \
   config_opts="$config_opts --with-tls"
 [ $config_debug = y ]  &&  \
-  config_opts="$config_opts --enable-debug"
+  config_opts="$config_opts --enable-debug --enable-assert"
 
 
 #### dotlocking, the usual default, requires chgrp and chmod of inc.
index f5796c4..66bcf10 100755 (executable)
@@ -117,7 +117,7 @@ do_viewhtml()
        > /tmp/ml-mhshow-html$$
 
     MHSHOW=/tmp/ml-mhshow-html$$ \
-    MM_CHARSET=us-ascii \
+    LC_ALL=C \
        mhshow -type text/html "$@"
 
     rm -f /tmp/ml-mhshow-html$$
index 8c1de2b..b2d2a82 100644 (file)
@@ -114,6 +114,9 @@ OBSOLETE FEATURES
   ap(8) commands has been removed.
 - "make install" no longer strips executables.  Use "make install-strip"
   instead.
+- The environment variable MM_CHARSET to indicate the native character
+  set is no longer supported.  The native character set will be solely
+  determined by the locale settings.
 
 -------------------
 DEPRECATED FEATURES
index 284d8c5..14d1c5a 100644 (file)
@@ -773,48 +773,6 @@ additional user profile (file) to be read by
 in addition to the mhn.defaults profile.
 .RE
 .PP
-.B $MM_CHARSET
-.RS 5
-With this environment variable, you can specify
-the native character set you are using.  You must be able to display
-this character set on your terminal.
-.PP
-This variable is checked to see if a RFC 2047 header field should be
-decoded (in
-.BR inc ,
-.BR scan ,
-.BR mhl ).
-This variable is
-checked by
-.B show
-to see if the
-.I showproc
-or
-.I showmimeproc
-should
-be called, since showmimeproc will be called if a text message uses
-a character set that doesn't match
-.BR $MM_CHARSET .
-This variable is
-checked by
-.B mhshow
-for matches against the charset parameter
-of text contents to decide it the text content can be displayed
-without modifications to your terminal.  This variable is checked by
-.B mhbuild
-to decide what character set to specify in the charset
-parameter of text contents containing 8\-bit characters.
-.PP
-When decoding text in such an alternate character set,
-.B nmh
-must be able to determine which characters are alphabetic, which
-are control characters, etc.  For many operating systems, this
-will require enabling the support for locales (such as setting
-the environment variable
-.B $LC_CTYPE
-to iso_8859_1).
-.RE
-.PP
 .B $MAILDROP
 .RS 5
 This variable tells
index 8cf5989..e4bd793 100644 (file)
@@ -464,7 +464,9 @@ If a text content contains any 8\-bit characters (characters with the
 high bit set) and the character set is not specified as above, then
 .B mhbuild
 will assume the character set is of the type given by the
-environment variable MM_CHARSET.  If this environment variable is not
+standard
+.IR locale (1)
+environment variables.  If these environment variables are not
 set, then the character set will be labeled as \*(lqx-unknown\*(rq.
 .PP
 If a text content contains only 7\-bit characters and the character set
index 4ecb614..ac46c01 100644 (file)
@@ -1,4 +1,4 @@
-.TH MHPATH %manext1% "November 6, 2012" "%nmhversion%"
+.TH MHPATH %manext1% "January 20, 2014" "%nmhversion%"
 .\"
 .\" %nmhwarning%
 .\"
@@ -115,6 +115,7 @@ is also useful in backquoted operations:
 /r/phyl/Mail
 .fi
 .RE
+.PP
 Because
 .B mhpath
 expands and sorts
@@ -138,12 +139,14 @@ mv `mhpath 501` `mhpath 500`
 .PP
 will do the trick.
 .PP
-Out of range message 0 is treated far more severely than large out of
-range message numbers.
+Out-of-range message 0 produces a different error message than large
+out-of-range message numbers.  But both cause
+.B mhpath
+to exit with non-zero status.
 .SH FILES
 .fc ^ ~
 .nf
-.ta \w'%etcdir%/ExtraBigFileName  'u
+.ta \w'ExtraBigProfileName  'u
 ^$HOME/\&.mh\(ruprofile~^The user profile
 .fi
 .SH "PROFILE COMPONENTS"
index f55fbfe..9cc44c1 100644 (file)
@@ -328,15 +328,15 @@ encounters a \*(lqcharset\*(rq parameter for
 this content, it checks if your terminal can display this character
 set natively.
 .B mhn
-checks this by examining the environment
-variable
-.BR $MM_CHARSET .
-If the value of this environment variable is equal
+checks this by examining the current character set defined by the
+.IR locale (1)
+environment variables.
+If the value of the locale character set is equal
 to the value of the charset parameter, then
 .B mhshow
 assumes it can
-display this content without any additional setup.  If this environment
-variable is not set,
+display this content without any additional setup.  If the locale is not
+set properly,
 .B mhshow
 will assume a value of \*(lqUS-ASCII\*(rq.
 If the character set cannot be displayed natively, then
index b9c94f4..17a702c 100644 (file)
@@ -73,9 +73,12 @@ these scan listings.
 .B Scan
 will only decode these fields if your
 terminal can natively display the character set used in the encoding.
-You should set the MM_CHARSET environment variable to your native
-character set, if it is not US-ASCII.  See the mh-profile(5) man
-page for details about this environment variable.
+You should set the appropriate
+.IR locale (1)
+environment variables to your native
+character set, if it is not US-ASCII.  See
+.IR locale (1)
+for more details on the appropriate environment variables.
 .PP
 The switch
 .BR \-reverse ,
index c69a7d7..04589fb 100644 (file)
@@ -92,14 +92,15 @@ specify a transfer encoding (such as MIME quoted-printable or
 base64) or specify a character set that
 .B show
 doesn't believe
-can be displayed natively.  The environment variable
-.B $MM_CHARSET
+can be displayed natively.  The appropriate
+.IR locale (1)
+environment variables
 should be set to the terminal's native character set to avoid
 gratuitous invocations of the
 .IR showmimeproc .
 See the
-.IR mh-profile (5)
-man page for details about this environment variable.
+.IR locale (1)
+man page for details about these environment variables.
 .PP
 The option
 .B \-checkmime
index e43459e..4f2eeba 100644 (file)
@@ -8,9 +8,8 @@
  */
 
 #include <h/mh.h>
-#ifdef HAVE_LANGINFO_H
-# include <langinfo.h>
-#endif
+
+#include <langinfo.h>
 
 
 /*
 char *
 get_charset ()
 {
-    char *charset = getenv ("MM_CHARSET");
-#if defined(HAVE_NL_LANGINFO) && defined(CODESET)
-    if (!charset)
-       charset = norm_charmap(nl_langinfo (CODESET));
-#endif
-    return charset;
+    return norm_charmap(nl_langinfo (CODESET));
 }
 
 
index 537a275..581214b 100644 (file)
@@ -568,7 +568,7 @@ field_encode_address(const char *name, char **value, int encoding,
 
     for (groupflag = 0; (mp = getname(*value)); ) {
        if ((mn = getm(mp, NULL, 0, errbuf, sizeof(errbuf))) == NULL) {
-           advise(mp, "%s", errbuf);
+           advise(NULL, "%s: %s", errbuf, mp);
            errflag++;
            continue;
        }
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 13db440..be8b25d 100644 (file)
@@ -23,7 +23,7 @@ test -z "$MH_INST_DIR"  &&  MH_INST_DIR="${MH_TEST_DIR}/inst"
 export MH_INST_DIR
 
 unset MHBUILD MHCONTEXT MHMTSUSERCONF MHN MHSHOW MHSTORE
-unset MHLDEBUG MHPDEBUG MHWDEBUG MM_CHARSET PAGER
+unset MHLDEBUG MHPDEBUG MHWDEBUG PAGER
 
 #### Use a test dir for tmp files when MHTMPDIR applies.
 MHTMPDIR=$MH_TEST_DIR/Mail
index f75e203..ea00b81 100755 (executable)
@@ -263,7 +263,7 @@ echo 13 >"$expected"
 set +e
 
 # Don't use run_prog here because it loses the environment setting.
-LC_CTYPE=en_US.UTF-8 pick -subject foobar 13 >"$actual" 2>&1
+LC_ALL=en_US.UTF-8 pick -subject foobar 13 >"$actual" 2>&1
 set -e
 check "$expected" "$actual"
 
index c78a4d2..fb9747d 100755 (executable)
@@ -94,8 +94,8 @@ Message-Id: 12@test.nmh
 Subject: =?UTF-8?B?MjAxMyBOZXcgWWVhcuKAmXMgRGVhbHMhIFN0YXJ0IHRoZSB5ZWFy?=
        =?UTF-8?B?IHJpZ2h0IHdpdGggYmlnIHNhdmluZ3M=?=
 
-This message has an encoded Subject with an invalid character for the
-ISO-8859-1 character set, but it (U+2019) is valid UTF-8.
+This message has an encoded Subject with an invalid character for
+single-byte character sets, but it (U+2019) is valid UTF-8.
 EOF
 
 if test "$ICONV_ENABLED" -eq 1; then
@@ -103,8 +103,8 @@ if test "$ICONV_ENABLED" -eq 1; then
   12  12/31 Test12             2013 New Year?s Deals! Start the year right
 EOF
 
-    # Don't use run_prog here because it loses those environment settings.
-    LC_CTYPE=ISO-8859-1 MM_CHARSET=ISO-8859-1 scan -width 75 last >"$actual"
+    # Don't use run_prog here because it loses the environment setting.
+    LC_ALL=C scan -width 75 last >"$actual"
     check "$expected" "$actual"
 fi
 
@@ -132,15 +132,16 @@ else
     echo "Unsupported width for U+2019: $width"
 fi
 
-LC_CTYPE=en_US.UTF-8 MM_CHARSET=UTF-8 scan -width 75 last >"$actual"
+run_prog scan -width 75 last >"$actual"
 check "$expected" "$actual"
 
 
-cat >"$expected" <<EOF
-  13  01/13 sender@example.co  ? <<The Subject: is an encoded single quote, 0x9
+if test "$ICONV_ENABLED" -eq 1; then
+  cat >"$expected" <<EOF
+  13  01/13 sender@example.co  <<The Subject: is an encoded single quote, 0x92.
 EOF
 
-cat >"${MH_TEST_DIR}/Mail/inbox/13" <<EOF
+  cat >"${MH_TEST_DIR}/Mail/inbox/13" <<EOF
 From: <sender@example.com>
 Subject: =?iso-8859-1?B?kgo=?=
 Date: Mon, 13 Jan 2014 14:18:33 -0600
@@ -153,8 +154,9 @@ properly count it when decoding, which could be seen with:
 The scan listing was two characters too long.
 EOF
 
-LC_CTYPE=ISO-8859-1 MM_CHARSET=ISO-8859-1 scan -width 80 last >"$actual"
-check "$expected" "$actual"
+  run_prog scan -width 80 last >"$actual"
+  check "$expected" "$actual"
+fi
 
 
 exit $failed
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 681c4fe..85b5a21 100644 (file)
@@ -116,9 +116,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 3ba82fb..626eba1 100644 (file)
@@ -118,9 +118,7 @@ main (int argc, char **argv)
     struct msgs *mp;
     struct stat st;
 
-#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 e014399..1344738 100644 (file)
@@ -57,9 +57,7 @@ main (int argc, char **argv)
     char *cp, buf[BUFSIZ];
     char **argp, **arguments;
 
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
     invo_name = r1bindex (argv[0], '/');
 
     context_read();
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 */