Subject: elm 2.4 Patch #23a
Summary: This is an official patch for elm 2.4 system.  Please apply it.
Priority: HIGH

THIS IS PART 1 OF A 5 PART PATCH


Write options to elmrc even if their values are empty strings.
Rationalize code that reads and writes weedouts and alternates.
From: chip%[email protected]

Correct problem in fetch_alias() with alias record fixup that caused
core dump on machines with pointers larger than int.  This problem
was reported on comp.mail.elm by Richard Eckman and Jim Brown.  Simplify
get_one_alias() by having it use fetch_alias().

break_down_tolist() tried to blindly split address lists at "," which
caused bogus results with addreses that had a comma inside a comment
or quoted text, such as "user@domain (Last, First)".  This patch steps
through the address in quanta of RFC-822 tokens when searching for a
delimiting comma.  It also adds "rfc822_toklen()" to the library to
get that length.
From: [email protected] (Chip Rosenthal)

This fixes a bug in the MIME code.  Include_Part() uses expand_env()
to expand the include file name, but since expand_env() is destructive
[it uses strtok()] the file name gets corrupted, and the "Content-Name"
header can contain a bogus value.  The easy fix would be a one-line
hack to Include_Part to use a temporary buffer.  This patch does not
implement the easy fix.  *Every* place expand_env() is used, its side
effects cause problems.  I think the right fix is to make expand_env()
non-destructive (i.e. have it duplicate the input to a temporary buffer
and work from there).  The attached patch modifies expand_env() in
that manner, and eliminates all of the `copy to a temporary buffer'
calls that precede it throughout elm.
From: [email protected] (Chip Rosenthal)

I have been repetedly crashing elm 2.4.22 until I discovered that a
test for failing to open the system elmrc file is mising. This could
usefully be added in read_rc.c. Version info and patch follows:
From: "C.R. Ritson" <[email protected]>

Greatly simplified "lib/striparens.c" to use new rfc822_toklen() routine.
This cut more than 50% out of the object size.  Also added _TEST case.
From: [email protected] (Chip Rosenthal)

When resyncing aliases from elm, and there was aliases to delete,
the alias.pag file could be corrupted since file_offset wasn't set to zero.
From: [email protected] (Jan Djarv)

A long-standing bug of handling replies to VMS systems.
Original "From: " -line is of format:
       From: "NAME \"Real Name\"" <USERNAME@vms-system>
(PMDF mailer)
       Anyway,  parse_arpa_who()  strips quotes too cleanly
resulting data:
       NAME \"Real Name\
which, when put into parenthesis, becomes:
       (NAME \"Real Name\)
which in its turn lacks closing `)'
Patch of  lib/parsarpwho.c  fixes that.
strtokq() started one position too late to search for next double-quote (") char.
Another one-off (chops off trailing comment character, quote or not..)  in   src/reply.c
From:   Matti Aarnio <[email protected]>

Three changes to expand_env() in src/read_rc.c:  make it non-destructive,
have it return an error code instead of bailing out, and add a buffer
size argument to avoid overwritting the destination.  The first is to
avoid all of the gymnastics Elm needed to go through (and occasionally
forgot to go through) to protect the value handed to expand_env().
The second is because expand_env() was originally written to support
"elmrc" and bailing out was a reasonable thing to do there -- but not
in the other places where it has since been used.  The third is just
a matter of practicing safe source code.

This patch changes all invocations to expand_env() to eliminate making
temporary copies (now that the routine is non-destructive) and to pass
in a destination length.  Since expand_env() no longer bails out on
error, a do_expand_env() routine was added to src/read_rc.c handle
this.  Moreover, the error message now gives some indication of what
the problem is rather than just saying "can't expand".

Gratitous change to src/editmsg.c renaming filename variables to
clarify the purpose.
From: [email protected] (Chip Rosenthal)

[ Patch description ]
Update the example elmrc and move a couple out of order variable
descriptions.
From: [email protected] (Dave Wolfe)

Handle reply-to in batch mode.
From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)

In fastmail, if environment variable $REPLYTO is set, use it as
default Reply-To.  Also, eliminate unnecessary strlen() calls.
From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)

Support aliases both on 64 bit and 32 bit machines at the same time.
From: Dan Mosedale <[email protected]>

Spaces in weedout strings wasn't preserved ("From " became "From").
From: [email protected] (Jan Djarv)

Added text about how the weedout list works w.r.t From: and From_
From: [email protected] (Jan Djarv)

default_weedlist() can't use pmalloc, because weedout() calls free when
it encounters *clear-weed-list*.
From: [email protected] (Jan Djarv)

The NLS messages for elm -h output didn't have the -i or -t options.
From: [email protected] (Jan Djarv)

The message CannotInitErrorExpanding was called CantExpandEnvVar in s_elm.m.
Change it for consistency.
From: [email protected] (Jan Djarv)

Since it was not intended that varargs.h and stdarg.h were
included simultaneously there may be colliding definitions
on some systems if you use a standard C compiler. If both
of these headers are included the compiler has no way to
know which definitions to use.
From: Jukka Ukkonen <[email protected]>

"*clear-weed-list*" in elmrc was wiped out when one saved the options in elm.
From: [email protected] (Jan Djarv)

When STDC is used on Convex the feof() function is defined as
a true library routine in the header files and moreover the
library routine also leaks royally. It returns always 1!!
So we have to use a macro. Convex naturally does not provide
you with one though if you are using a STDC compiler. So we
have to include one.
From: Jukka Ukkonen <[email protected]>

Removed bogus string lockfile.
From: [email protected] (Jan Djarv)

The last character of a form field gets zapped if more characters than
the field expects are entered.
From: [email protected] (Dave Wolfe)

Patch for Elm 2.4 PL22 to correct handling of SIGWINCH signals on
DecStations with Ultrix 4.2.
The problem was that elm running in an xterm exits silently when the
window is resize. This was caused by incorrect signal handling for BSD.
From: [email protected]

Implement new timezone handling.  New file lib/get_tz.c with new timezone
routines.  Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
definitions.  Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
definitions.  Updated Configure.  Modified lib/getarpdate.c and
lib/strftime.c to use new timezone routines.
From: [email protected] (Chip Rosenthal)

Add proper casts to free() calls to suppress warnings.
Properly cast return types.
From: [email protected] (Chip Rosenthal)

Added -d option to elmalias.
From: [email protected] (Jan Djarv)

Elm tries to replace the system toupper() and tolower() on current
BSD systems, which is unnecessary.  Even worse, the replacements
collide during linking with routines in isctype.o.  This patch adds
a Configure test to determine whether replacements are really needed
(BROKE_CTYPE definition).  The <ctype.h> header file is now included
globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
there.  Inclusion of <ctype.h> was removed from *all* the individual
files, and the toupper() and tolower() routines in lib/opt_utils.c
were dropped.
From: [email protected] (Chip Rosenthal)

Fix signal type for 386bsd
From: Scott Mace <[email protected]>

When an environment variable was given as the tmpdir definition the src
and dest overlapped in expand_env.  This made elm produce a garbage
expansion because expand_env cannot cope with overlapping src and
dest.  I added a new variable raw_temp_dir to keep src and dest not to
overlap.
From: Jukka Ukkonen <[email protected]>

I compiled elm 2.4.22 with Purify 2 and fixed some memory leaks and
some reads of unitialized memory.
From: [email protected]

A change to answer:s mail command to be like those of elm and filter.
From: [email protected] (Jan Djarv)

Elm was failing to write an empty "alternatives" list to elmrc.
From: [email protected] (Chip Rosenthal)

Usage message for elmalias changed.
From: [email protected] (Jan Djarv)

Correct typo and use hard spaces within quotes in *clear-weed-list* note.
From: [email protected] (Dave Wolfe)

fix where checkalias doesn't fully expand multi-database aliases
From: Steve Wolf <[email protected]>

The macro ctrl(c) did not work correctly for a DEL character
neither did it make the backward mapping from a control char
to the letter that is normally used with an up-arrow prefix
to represent the control character.
From: Jukka Ukkonen <[email protected]>

Don't declare _exit() if <unistd.h> already did it.
From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)

Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)

The ANSI version of varargs is "stdarg", not "stdargs".
From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)

Added some documentation for textencoding variable.
From: [email protected] (Jan Djarv)

more purify found errors
From: [email protected]

Add missing parens
From: [email protected] (Dave Wolfe)

Fix problem where deleting to previous line caused duplication due to the
file being opened for append (in append mode, all writes are to the end of
file regardless of the file pointer).
From: [email protected] (Paul Close)

have Writechar() backspace over the left edge of the screen to the end
of the previous line if the current line is not the first line on the
screen.
From: Jukka Ukkonen <[email protected]>

Call to expand_env for pager should be call to do_expand_env.
temp_dir not initialized.
From: [email protected] (Jan Djarv)

Try splitting chown into two calls to set group on systems where
chown of owner is restricted.
From: Syd

strtokq was called with the wrong number of parameters.
From: [email protected] (Jan Djarv)

Add ability for elmalias to determine HOME if missing from the environment.
From: [email protected] (Chip Rosenthal)

Changed a few buffers from LONG_STRING (512) to VERY_LONG_STRING
to avoid long header lines overflowing the allocated space. At
least 1024 bytes should be allowed in any header line/field.
From: Jukka Ukkonen <[email protected]>

Here's some more patch stuff for undersize buffers for header lines.
From: Jukka Ukkonen <[email protected]>

Fix a code portability problem with Convex.
From: Jukka Ukkonen <[email protected]>

I found a few places more where the code was missing a call
to fflush() before it called unlock() and fclose()/exit()
right after unlocking the mail drop.
From: Jukka Ukkonen <[email protected]>

Erroneous Content-Length:s that ended up beyond the end of the folder
wasn't checked for, so the rest of the folder became one big message.
From: [email protected] (Jan Djarv)

expand() didn't read the global rc file if the user elmrc didn't exist or
didn't have an entry for maildir.
From: [email protected] (Jan Djarv)

Conform textencoding addition to style standard.
From: [email protected] (Dave Wolfe)

Although it doesnt solve the limit/resync problem of new
messages, allow them to be accessed anyway.
From: [email protected]


Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your elm source
       directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
       If you don't have the patch program, apply the following by hand,
       or get patch (version 2.0, latest patchlevel).

       After patching:
               Apply patches 23b, 23c, 23d, 23e next

       If patch indicates that patchlevel is the wrong version, you may need
       to apply one or more previous patches, or the patch may already
       have been applied.  See the patchlevel.h file to find out what has or
       has not been applied.  In any event, don't continue with the patch.

       If you are missing previous patches they can be obtained from our:
       archive server.

       Syd Weinstein
       [email protected]

       The patches are available from the dsinc archive server
       Send the following message to [email protected] for
       a list of available patches:

       Subject: patch list
       send index elm

Index: hdrs/patchlevel.h
Prereq: "22"
*** ../elm2.4/hdrs/patchlevel.h Sun Jun  6 14:24:45 1993
--- hdrs/patchlevel.h   Sun Sep 26 21:27:22 1993
***************
*** 1 ****
! #define PATCHLEVEL "22"
--- 1 ----
! #define PATCHLEVEL "23"


Index: Configure
Prereq: 5.28
*** ../elm2.4/Configure Sun Jun  6 14:24:46 1993
--- Configure   Sun Sep 26 21:51:53 1993
***************
*** 8,14 ****
 # and edit it to reflect your system.  Some packages may include samples
 # of config.h for certain machines, so you might look for one of those.)
 #
! # $Header: /home/syd/elm.rel/RCS/Configure,v 5.28 1993/06/06 18:11:06 syd Exp $
 #
 # Yes, you may rip this off to use in other distribution packages.
 # (Note: this Configure script was generated automatically.  Rather than
--- 8,14 ----
 # and edit it to reflect your system.  Some packages may include samples
 # of config.h for certain machines, so you might look for one of those.)
 #
! # $Header: /home/syd/elm.rel/RCS/Configure,v 5.36 1993/09/27 01:51:38 syd Exp $
 #
 # Yes, you may rip this off to use in other distribution packages.
 # (Note: this Configure script was generated automatically.  Rather than
***************
*** 122,131 ****
 execmail=''
 libswanted=''
 c_date=''
- d_altcheck=''
 d_ascii=''
 d_calendar=''
 calendar=''
 d_content=''
 d_crypt=''
 cryptlib=''
--- 122,132 ----
 execmail=''
 libswanted=''
 c_date=''
 d_ascii=''
+ d_broke_ctype=''
 d_calendar=''
 calendar=''
+ d_chown_neg1=''
 d_content=''
 d_crypt=''
 cryptlib=''
***************
*** 166,172 ****
 d_newauto=''
 d_noaddfrom=''
 d_usedomain=''
- d_nocheckvalid=''
 d_noxheader=''
 d_pidcheck=''
 d_ptem=''
--- 167,172 ----
***************
*** 200,207 ****
 tempnamc=''
 d_termio=''
 d_termios=''
- d_tz_min=''
- d_tzname=''
 d_useembed=''
 d_utimbuf=''
 d_vfork=''
--- 200,205 ----
***************
*** 213,218 ****
--- 211,217 ----
 mydomain=''
 autohostname=''
 i_memory=''
+ i_stdarg=''
 i_stdlib=''
 i_time=''
 i_systime=''
***************
*** 262,267 ****
--- 261,268 ----
 shsharp=''
 sharpbang=''
 tmpdir=''
+ tzmins_handling=''
+ tzname_handling=''
 use_pmake=''
 xencf=''
 xenlf=''
***************
*** 818,823 ****
--- 819,858 ----
       calendar="$ans"
 fi

+ : check to see if the macros are 8-bit clean, ask the user
+ :
+ $cat <<EOM
+
+
+ Not all environments are restricted to the ASCII 7-bit character set.
+ For example, the ISO 8859/1 (Latin alphabet no. 1) character set,
+ consisting of 8 bits and 191 printable characters, is becoming
+ more and more common, especially in non-English speaking countries.
+
+ Unfortunately, not all isprint() functions or macros, which ELM
+ uses to determine whether a character is printable or not, will
+ handle non-ASCII (8-bit) characters properly.  It is suggested that you
+ start with this value configured to handle 8-bit characters correctly
+ and if there are problems with Elm aborting while displaying messages
+ that use extended character sets to reconfigure Elm to only display
+ 7-bit characters.
+
+ EOM
+
+ case "$d_ascii" in
+     "$define")   dflt='n';;
+     *)  dflt='y';;
+ esac
+
+ echo "  "
+ rp="Should Elm assume that isprint() won't break on non-ASCII characters? [$dflt]"
+ $echo $n "$rp $c"
+ . myread
+ case "$ans" in
+     y*) d_ascii="$undef";;
+     *) d_ascii="$define";;
+ esac
+
 : make some quick guesses about what we are up against
 echo " "
 $echo $n "Hmm...  $c"
***************
*** 846,851 ****
--- 881,891 ----
       echo exit 1 >bsd
       echo exit 1 >usg
       echo exit 1 >v7
+     elif $test "$uname_os" = "HP-UX" ; then
+       echo "Looks like an HP-UX system, but we'll see.."
+       echo exit 1 >bsd
+       echo exit 0 >usg
+       echo exit 1 >v7
     else
       echo "Looks kind of like a BSD system, but we'll see..."
       echo exit 0 >bsd
***************
*** 901,906 ****
--- 941,1039 ----
 rm -rf foo
 rmlist="$rmlist bsd usg v7 eunice venix xenix"

+ : find out how to find out full name
+ echo " "
+ case "$d_berknames" in
+ "$define")
+     dflt=y;;
+ "$undef")
+     dflt=n;;
+ *)
+     if bsd; then
+       dflt=y
+     elif xenix; then
+       dflt=y
+     else
+       dflt=n
+     fi
+     ;;
+ esac
+ echo "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
+ $echo $n "thing after ':' in GCOS field)? [$dflt] $c"
+ rp="Berkeley/V7 format full name? [$dflt]"
+ . myread
+ case "$ans" in
+   y*)
+     d_passnames="$define"
+     d_berknames="$define"
+     d_usgnames="$undef"
+     nametype=bsd
+     ;;
+   *)
+     echo " "
+     case "$d_usgnames" in
+     "$define")
+       dflt=y;;
+     "$undef")
+       dflt=n;;
+     *)
+       if usg; then
+           dflt=y
+       else
+           dflt=n
+       fi
+       ;;
+     esac
+     echo "Does your passwd file keep full names in USG format (name sandwiched"
+     $echo $n "between a '-' and a '(')? [$dflt] $c"
+     rp="USG format full name? [$dflt]"
+     . myread
+     case "$ans" in
+       n*)
+       echo "Full name will be taken from ~/.fullname"
+       d_passnames="$undef"
+       d_berknames="$undef"
+       d_usgnames="$undef"
+       nametype=other
+       ;;
+       *)
+       d_passnames="$define"
+       d_berknames="$undef"
+       d_usgnames="$define"
+       nametype=usg
+       ;;
+     esac
+     ;;
+ esac
+
+ : see if we have to deal with yellow pages, if so, put sun
+ : library first, as the yp password routines must override
+ : the c library ones
+ if $test -d /usr/etc/yp || $test -d /etc/yp; then
+     if $test "$passcat" = "ypcat passwd"; then
+       dflt=y
+     elif $contains '^\+:' /etc/passwd; then
+       dflt=y
+     else
+       dflt=n
+     fi
+     rp="Are you getting the passwd file via yellow pages? [$dflt]"
+     $echo $n "$rp $c"
+     . myread
+     case "$ans" in
+     y*) passcat='ypcat passwd'
+       case "$libswanted" in
+       '') libswanted='sun c_s';;
+       *)  libswanted=`$echo "$libswanted" | $sed -e 's/sun //g'`
+           libswanted="sun $libswanted";;
+       esac
+       ;;
+     *) passcat='cat /etc/passwd';;
+     esac
+ else
+     passcat='cat /etc/passwd'
+ fi
+
 # determine text processor to use, default to troff if found.
 case "$roff" in
 '')
***************
*** 1305,1403 ****
     d_bsd="$define"
 fi

- : find out how to find out full name
- echo " "
- case "$d_berknames" in
- "$define")
-     dflt=y;;
- "$undef")
-     dflt=n;;
- *)
-     if bsd; then
-       dflt=y
-     elif xenix; then
-       dflt=y
-     else
-       dflt=n
-     fi
-     ;;
- esac
- echo "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
- $echo $n "thing after ':' in GCOS field)? [$dflt] $c"
- rp="Berkeley/V7 format full name? [$dflt]"
- . myread
- case "$ans" in
-   y*)
-     d_passnames="$define"
-     d_berknames="$define"
-     d_usgnames="$undef"
-     nametype=bsd
-     ;;
-   *)
-     echo " "
-     case "$d_usgnames" in
-     "$define")
-       dflt=y;;
-     "$undef")
-       dflt=n;;
-     *)
-       if usg; then
-           dflt=y
-       else
-           dflt=n
-       fi
-       ;;
-     esac
-     echo "Does your passwd file keep full names in USG format (name sandwiched"
-     $echo $n "between a '-' and a '(')? [$dflt] $c"
-     rp="USG format full name? [$dflt]"
-     . myread
-     case "$ans" in
-       n*)
-       echo "Full name will be taken from ~/.fullname"
-       d_passnames="$undef"
-       d_berknames="$undef"
-       d_usgnames="$undef"
-       nametype=other
-       ;;
-       *)
-       d_passnames="$define"
-       d_berknames="$undef"
-       d_usgnames="$define"
-       nametype=usg
-       ;;
-     esac
-     ;;
- esac
-
- : see if we have to deal with yellow pages, if so, put sun
- : library first, as the yp password routines must override
- : the c library ones
- if $test -d /usr/etc/yp || $test -d /etc/yp; then
-     if $test "$passcat" = "ypcat passwd"; then
-       dflt=y
-     elif $contains '^\+:' /etc/passwd; then
-       dflt=y
-     else
-       dflt=n
-     fi
-     rp="Are you getting the passwd file via yellow pages? [$dflt]"
-     $echo $n "$rp $c"
-     . myread
-     case "$ans" in
-     y*) passcat='ypcat passwd'
-       case "$libswanted" in
-       '') libswanted='sun c_s';;
-       *)  libswanted=`$echo "$libswanted" | $sed -e 's/sun //g'`
-           libswanted="sun $libswanted";;
-       esac
-       ;;
-     *) passcat='cat /etc/passwd';;
-     esac
- else
-     passcat='cat /etc/passwd'
- fi
-
 : see what memory models we can support
 case "$models" in
 '')
--- 1438,1443 ----
***************
*** 1695,1701 ****
 '');;
 *)  set X $cppflags
     cppflags=''
!     for flag do
       case $flag in
       -D*|-I*|-U*) cppflags="$cppflags $flag";;
       esac
--- 1735,1742 ----
 '');;
 *)  set X $cppflags
     cppflags=''
!     for flag
!     do
       case $flag in
       -D*|-I*|-U*) cppflags="$cppflags $flag";;
       esac
***************
*** 1813,1907 ****
 esac
 libs="$ans"

- : check for "existence of altzone"
- echo " "
- case "$d_altcheck" in
- "$define")    ;;
- "$undef")     ;;
- *)
-           echo "Checking to see if altzone exists as a global variable works..."
-           $rm -f try try.o
-           $cat >try.c <<'EOCP'
-
- main()
-       {
-       long    t;
-       extern  long    altzone;
-
-       t = altzone;
-
-       exit(0);
-       }
- EOCP
-           if $cc try.c -o try >/dev/null 2>&1 ; then
-               d_altcheck="$define"
-               echo "Your system supports altzone..."
-           else
-               d_altcheck="$undef"
-               echo "Your system does not support altzone..."
-           fi
-           $rm -f try.c try.o try
-       ;;
- esac
-
- : check to see if the macros are 8-bit clean, ask the user
- :
- $cat <<EOM
-
-
- Not all environments are restricted to the ASCII 7-bit character set.
- For example, the ISO 8859/1 (Latin alphabet no. 1) character set,
- consisting of 8 bits and 191 printable characters, is becoming
- more and more common, especially in non-English speaking countries.
-
- Unfortunately, not all isprint() functions or macros, which ELM
- uses to determine whether a character is printable or not, will
- handle non-ASCII (8-bit) characters properly.  It is suggested that you
- start with this value configured to handle 8-bit characters correctly
- and if there are problems with Elm aborting while displaying messages
- that use extended character sets to reconfigure Elm to only display
- 7-bit characters.
-
- EOM
-
- case "$d_ascii" in
-     "$define")   dflt='n';;
-     *)  dflt='y';;
- esac
-
- echo "  "
- rp="Should Elm assume that isprint() won't break on non-ASCII characters? [$dflt]"
- $echo $n "$rp $c"
- . myread
- case "$ans" in
-     y*) d_ascii="$undef";;
-     *) d_ascii="$define";;
- esac
-
-
- case "$d_content" in
- "$define") dflt=y;;
- "$undef")  dflt=n;;
- *)       dflt=n;;
- esac
-
- $cat << EOM
-
- Some modern Mail Transport Agents (mailers) support the Content-Length: header.
- In doing so, they do not wish to have messages escaped to protect 'From ' lines
- in the body of the message, among other strings.  Does the Mail Transport Agent
- in use on this system honor the Content-Length: header?
- EOM
-
- echo " "
- rp="Honors Content-Length: header? [$dflt]"
- $echo $n "$rp $c"
- . myread
- case "$ans" in
- y*) d_content="$define";;
- *)  d_content="$undef";;
- esac
-
 : get list of predefined functions in a handy place
 echo " "
 case "$libc" in
--- 1854,1859 ----
***************
*** 2100,2105 ****
--- 2052,2301 ----
 :
 : rmlist="$rmlist libc.tmp libc.list"
 :
+ : see how we invoke the C preprocessor
+ echo " "
+ echo "Now, how can we feed standard input to your C preprocessor..."
+ cat <<'EOT' >testcpp.c
+ #define ABC abc
+ #define XYZ xyz
+ ABC.XYZ
+ EOT
+ echo 'Maybe "'"$cc"' -E" will work...'
+ $cc -E <testcpp.c >testcpp.out 2>&1
+ : try to force gcc preprocessor if that is the compiler they are using
+ case $? in
+ 0) cppstdin="$cc -E";;
+ *) case "$cc" in
+     *gcc*)
+       cd ..
+       echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
+       echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
+       chmod 755 cppstdin
+       cppstdin=`pwd`/cppstdin
+       cppminus='';
+       cd UU
+       $cppstdin <testcpp.c >testcpp.out 2>&1
+       ;;
+     esac
+     ;;
+ esac
+ if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+     echo "Yup, it does."
+     cppstdin="$cc -E"
+     cppminus='';
+ else
+     echo 'Nope, maybe "'$cpp'" will work...'
+     $cpp <testcpp.c >testcpp.out 2>&1
+     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+       echo "Yup, it does."
+       cppstdin="$cpp"
+       cppminus='';
+     else
+       echo 'No such luck...maybe "'$cpp' -" will work...'
+       $cpp - <testcpp.c >testcpp.out 2>&1
+       if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+           echo "It works!"
+           cppstdin="$cpp"
+           cppminus='-';
+       else
+           echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
+           $cc -E - <testcpp.c >testcpp.out 2>&1
+           if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+               echo "Hooray, it works!  I was beginning to wonder."
+               cppstdin="$cc -E"
+               cppminus='-';
+           else
+               echo 'Nope...maybe "'"$cc"' -P" will work...'
+               $cc -P <testcpp.c >testcpp.out 2>&1
+               if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+                   echo "Yup, that does."
+                   cppstdin="$cc -P"
+                   cppminus='';
+               else
+                   echo 'Nope...maybe "'"$cc"' -P -" will work...'
+                   $cc -P - <testcpp.c >testcpp.out 2>&1
+                   if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+                       echo "Yup, that does."
+                       cppstdin="$cc -P"
+                       cppminus='-';
+                   else
+                       echo 'Hmm...perhaps you already told me...'
+                       case "$cppstdin" in
+                       '') ;;
+                       *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
+                       esac
+                       if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+                           echo "Hooray, you did!  I was beginning to wonder."
+                       else
+                           echo 'Uh-uh.  Time to get fancy...'
+                           cd ..
+                           echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
+                           echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
+                           chmod 755 cppstdin
+                           cppstdin=`pwd`/cppstdin
+                           cppminus='';
+                           cd UU
+                           $cppstdin <testcpp.c >testcpp.out 2>&1
+                           if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+                               echo "Eureka!."
+                           else
+                               dflt=blurfl
+                               $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
+                               rp='Name a C preprocessor:'
+                               . myread
+                               cppstdin="$ans"
+                               $cppstdin <testcpp.c >testcpp.out 2>&1
+                               if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+                                   echo "OK, that will do."
+                               else
+                                   echo "Sorry, I can't get that to work.  Go find one."
+                                   exit 1
+                               fi
+                           fi
+                       fi
+                   fi
+               fi
+           fi
+       fi
+     fi
+ fi
+ rm -f testcpp.c testcpp.out
+
+ : get C preprocessor symbols handy
+ echo " "
+ echo $attrlist | $tr ' ' '\012' >Cppsym.know
+ $cat <<EOSS >Cppsym
+ $startsh
+ case "\$1" in
+ -l) list=true
+     shift
+     ;;
+ esac
+ unknown=''
+ case "\$list\$#" in
+ 1|2)
+     for sym
+     do
+       if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
+           exit 0
+       elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
+               :
+       else
+           unknown="\$unknown \$sym"
+       fi
+     done
+     set X \$unknown
+     shift
+     ;;
+ esac
+ case \$# in
+ 0) exit 1;;
+ esac
+ echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
+ #ifdef \1\\
+ exit 0; _ _ _ _\1\\    \1\\
+ #endif\\
+ /' >/tmp/Cppsym\$\$
+ echo exit 1 >>/tmp/Cppsym\$\$
+ $cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
+ case "\$list" in
+ true) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
+ *)
+     sh /tmp/Cppsym2\$\$
+     status=\$?
+     ;;
+ esac
+ $rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
+ exit \$status
+ EOSS
+ chmod +x Cppsym
+ $eunicefix Cppsym
+ echo "Your C preprocessor defines the following symbols:"
+ Cppsym -l $attrlist >Cppsym.true
+ cat Cppsym.true
+ rmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
+
+ : check for broken toupper/tolower
+ $echo ' '
+ case "$d_broke_ctype" in
+ "$define") ;;
+ "$undef") ;;
+ *)
+     $echo "Testing your \"ctype\" conversion routines..."
+     d_broke_ctype="$define"
+     $cat >try.c <<'EOF'
+ #include <stdio.h>
+ #include <ctype.h>
+ #define my_tolower(c) (isupper(c) ? (c) - 'A' + 'a' : (c))
+ #define my_toupper(c) (islower(c) ? (c) - 'a' + 'A' : (c))
+ main()
+ {
+     int i;
+     for (i = 1 ; i <= 0x7F ; ++i) {
+       if (my_tolower(i) != tolower(i) || my_toupper(i) != toupper(i))
+               exit(1);
+     }
+     exit(0);
+ }
+ EOF
+     $cc $ccflags -o try try.c >/dev/null 2>&1 \
+       && ./try >/dev/null 2>&1 && d_broke_ctype="$undef"
+     rm -f try.c try.o try core
+     ;;
+ esac
+ case "$d_broke_ctype" in
+ "$define")    $echo "Using our own \"ctype\" conversions." ;;
+ "$undef")     $echo "Using standard system \"ctype\" conversions." ;;
+ esac
+
+
+ : see if chown can take -1 for mantaining the user/group unchanged
+ echo " "
+
+ case "$d_chown_neg1" in
+ undef)  dflt=n;;
+ *)  dflt=y;;
+ esac
+
+ $cat <<EOM
+
+ Does your system allow chown(-1, group) and chown(user, -1) to
+ not change the user or group respectively.  This is usually documented
+ in the chown manual page (man 2 chown). (Most POSIX and BSD systems can,
+ Xenix cannot)
+
+ EOM
+ rp="Does this system allow -1 as chown argument? [$dflt]"
+ $echo $n "$rp $c"
+ . myread
+ case "$ans" in
+ y*) d_chown_neg1="$define";;
+ *)  d_chown_neg1="$undef";;
+ esac
+
+ case "$d_content" in
+ "$define") dflt=y;;
+ "$undef")  dflt=n;;
+ *)       dflt=n;;
+ esac
+
+ $cat << EOM
+
+ Some modern Mail Transport Agents (mailers) support the Content-Length: header.
+ In doing so, they do not wish to have messages escaped to protect 'From ' lines
+ in the body of the message, among other strings.  Does the Mail Transport Agent
+ in use on this system honor the Content-Length: header?
+ EOM
+
+ echo " "
+ rp="Honors Content-Length: header? [$dflt]"
+ $echo $n "$rp $c"
+ . myread
+ case "$ans" in
+ y*) d_content="$define";;
+ *)  d_content="$undef";;
+ esac
+
 : see if crypt exists
 echo " "
 if $contains '^crypt$' libc.list >/dev/null 2>&1; then
***************
*** 2678,2684 ****
 : index or strcpy
 echo " "
 case "$d_index" in
! n) dflt=n;;
 *) dflt=y;;
 esac
 if $contains '^index$' libc.list >/dev/null 2>&1 ; then
--- 2874,2880 ----
 : index or strcpy
 echo " "
 case "$d_index" in
! "$define") dflt=n;;
 *) dflt=y;;
 esac
 if $contains '^index$' libc.list >/dev/null 2>&1 ; then
***************
*** 2913,2918 ****
--- 3109,3118 ----
               rp="$ispell_path options: [$dflt]"
               . myread
               ispell_options=$ans;
+               case "$ispell_options" in
+               'none') ispell_options=''
+                    ;;
+               esac
               ;;
 esac
 : see if locale.h is in /usr/include
***************
*** 3178,3219 ****


 if $test -f "$sendmail"; then
!       echo "You're running sendmail.  Setting noaddfrom, nocheckvalid, usedomain"
       d_noaddfrom="$define"
-       d_nocheckvalid="$define"
       d_usedomain="$undef"
 elif $test -f "$submit"; then
!       echo "You're running submit with MMDF.  Setting noaddfrom, nocheckvalid, usedomain"
       d_noaddfrom="$undef"
-       d_nocheckvalid="$define"
       d_usedomain="$define"
 elif $test -f "$execmail" -a "$d_mmdf" = "$define"; then
!       echo "You're running execmail with MMDF.  Setting noaddfrom, nocheckvalid, usedomain"
       d_noaddfrom="$undef"
-       d_nocheckvalid="$define"
       d_usedomain="$undef"
 else
-       case "$d_nocheckvalid" in
-       "$define") dflt=n;;
-       "$undef")  dflt=y;;
-       *)         dflt=y;;
-       esac
-
-       $cat << EOM
-
- Since you're not running sendmail or submit, should I check local user entered
- addresses against the valid mailboxes on this system?
- EOM
-
-       echo " "
-       rp="Would you like to check local addresses? [$dflt]"
-       $echo $n "$rp $c"
-       . myread
-       case "$ans" in
-       y*) d_nocheckvalid="$undef";;
-       *)  d_nocheckvalid="$define";;
-       esac
-
       if $test "$d_internet" = "$define"; then
               case "$d_usedomain" in
               "$define") dflt=y;;
--- 3378,3395 ----


 if $test -f "$sendmail"; then
!       echo "You're running sendmail.  Setting noaddfrom, usedomain"
       d_noaddfrom="$define"
       d_usedomain="$undef"
 elif $test -f "$submit"; then
!       echo "You're running submit with MMDF.  Setting noaddfrom, usedomain"
       d_noaddfrom="$undef"
       d_usedomain="$define"
 elif $test -f "$execmail" -a "$d_mmdf" = "$define"; then
!       echo "You're running execmail with MMDF.  Setting noaddfrom, usedomain"
       d_noaddfrom="$undef"
       d_usedomain="$undef"
 else
       if $test "$d_internet" = "$define"; then
               case "$d_usedomain" in
               "$define") dflt=y;;
***************
*** 3333,3500 ****
     fi
 fi

- : see how we invoke the C preprocessor
- echo " "
- echo "Now, how can we feed standard input to your C preprocessor..."
- cat <<'EOT' >testcpp.c
- #define ABC abc
- #define XYZ xyz
- ABC.XYZ
- EOT
- echo 'Maybe "'"$cc"' -E" will work...'
- $cc -E <testcpp.c >testcpp.out 2>&1
- : try to force gcc preprocessor if that is the compiler they are using
- case $? in
- 0) cppstdin="$cc -E";;
- *) case "$cc" in
-     *gcc*)
-       cd ..
-       echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
-       echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
-       chmod 755 cppstdin
-       cppstdin=`pwd`/cppstdin
-       cppminus='';
-       cd UU
-       $cppstdin <testcpp.c >testcpp.out 2>&1
-       ;;
-     esac
-     ;;
- esac
- if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-     echo "Yup, it does."
-     cppstdin="$cc -E"
-     cppminus='';
- else
-     echo 'Nope, maybe "'$cpp'" will work...'
-     $cpp <testcpp.c >testcpp.out 2>&1
-     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-       echo "Yup, it does."
-       cppstdin="$cpp"
-       cppminus='';
-     else
-       echo 'No such luck...maybe "'$cpp' -" will work...'
-       $cpp - <testcpp.c >testcpp.out 2>&1
-       if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-           echo "It works!"
-           cppstdin="$cpp"
-           cppminus='-';
-       else
-           echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
-           $cc -E - <testcpp.c >testcpp.out 2>&1
-           if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-               echo "Hooray, it works!  I was beginning to wonder."
-               cppstdin="$cc -E"
-               cppminus='-';
-           else
-               echo 'Nope...maybe "'"$cc"' -P" will work...'
-               $cc -P <testcpp.c >testcpp.out 2>&1
-               if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-                   echo "Yup, that does."
-                   cppstdin="$cc -P"
-                   cppminus='';
-               else
-                   echo 'Nope...maybe "'"$cc"' -P -" will work...'
-                   $cc -P - <testcpp.c >testcpp.out 2>&1
-                   if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-                       echo "Yup, that does."
-                       cppstdin="$cc -P"
-                       cppminus='-';
-                   else
-                       echo 'Hmm...perhaps you already told me...'
-                       case "$cppstdin" in
-                       '') ;;
-                       *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
-                       esac
-                       if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-                           echo "Hooray, you did!  I was beginning to wonder."
-                       else
-                           echo 'Uh-uh.  Time to get fancy...'
-                           cd ..
-                           echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
-                           echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
-                           chmod 755 cppstdin
-                           cppstdin=`pwd`/cppstdin
-                           cppminus='';
-                           cd UU
-                           $cppstdin <testcpp.c >testcpp.out 2>&1
-                           if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-                               echo "Eureka!."
-                           else
-                               dflt=blurfl
-                               $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
-                               rp='Name a C preprocessor:'
-                               . myread
-                               cppstdin="$ans"
-                               $cppstdin <testcpp.c >testcpp.out 2>&1
-                               if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-                                   echo "OK, that will do."
-                               else
-                                   echo "Sorry, I can't get that to work.  Go find one."
-                                   exit 1
-                               fi
-                           fi
-                       fi
-                   fi
-               fi
-           fi
-       fi
-     fi
- fi
- rm -f testcpp.c testcpp.out
-
- : get C preprocessor symbols handy
- echo " "
- echo $attrlist | $tr ' ' '\012' >Cppsym.know
- $cat <<EOSS >Cppsym
- $startsh
- case "\$1" in
- -l) list=true
-     shift
-     ;;
- esac
- unknown=''
- case "\$list\$#" in
- 1|2)
-     for sym do
-       if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
-           exit 0
-       elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
-               :
-       else
-           unknown="\$unknown \$sym"
-       fi
-     done
-     set X \$unknown
-     shift
-     ;;
- esac
- case \$# in
- 0) exit 1;;
- esac
- echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
- #ifdef \1\\
- exit 0; _ _ _ _\1\\    \1\\
- #endif\\
- /' >/tmp/Cppsym\$\$
- echo exit 1 >>/tmp/Cppsym\$\$
- $cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
- case "\$list" in
- true) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
- *)
-     sh /tmp/Cppsym2\$\$
-     status=\$?
-     ;;
- esac
- $rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
- exit \$status
- EOSS
- chmod +x Cppsym
- $eunicefix Cppsym
- echo "Your C preprocessor defines the following symbols:"
- Cppsym -l $attrlist >Cppsym.true
- cat Cppsym.true
- rmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
-
 : see if there is a putenv
 set putenv d_putenv
 eval $inlibc
--- 3509,3514 ----
***************
*** 3840,3951 ****
     fi
 fi

- : see if we should include time.h, sys/time.h, or both
- cat <<'EOM'
-
- Testing to see if we should include <time.h>, <sys/time.h> or both.
- I'm now running the test program...
- EOM
- $cat >try.c <<'EOCP'
- #ifdef I_TIME
- #include <time.h>
- #endif
- #ifdef I_SYSTIME
- #ifdef SYSTIMEKERNEL
- #define KERNEL
- #endif
- #include <sys/time.h>
- #endif
- main()
- {
-     struct tm foo;
- #ifdef S_TIMEVAL
-     struct timeval bar;
- #endif
-     if (foo.tm_sec == foo.tm_sec)
-       exit(0);
- #ifdef S_TIMEVAL
-     if (bar.tv_sec == bar.tv_sec)
-       exit(0);
- #endif
-     exit(1);
- }
- EOCP
- flags=''
- for s_timeval in '-DS_TIMEVAL' ''; do
-     for d_systimekernel in '' '-DSYSTIMEKERNEL'; do
-       for i_time in '-DI_TIME' ''; do
-           for i_systime in '-DI_SYSTIME' ''; do
-               case "$flags" in
-               '') echo "Trying $i_time $i_systime $d_systimekernel $s_timeval"
-                   if $cc $ccflags $i_time $i_systime $d_systimekernel $s_timeval \
-                           try.c -o try >/dev/null 2>&1 ; then
-                       set X $i_time $i_systime $d_systimekernel $s_timeval
-                       shift
-                       flags="$*"
-                       echo "Succeeded with $flags"
-                   fi
-                   ;;
-               esac
-           done
-       done
-     done
- done
- case "$flags" in
- *SYSTIMEKERNEL*) d_systimekernel="$define";;
- *) d_systimekernel="$undef";;
- esac
- case "$flags" in
- *I_TIME*) i_time="$define";;
- *) i_time="$undef";;
- esac
- case "$flags" in
- *I_SYSTIME*) i_systime="$define";;
- *) i_systime="$undef";;
- esac
- $rm -f try.c try
-
- : see if there is a tzname
- set tzname d_tzname
- eval $inlibc
-
- if $test "$d_tzname" = "$undef"; then
-     set _tzname d_tzname
-     eval $inlibc
- fi
-
- timeincl=""
- if $test "$i_time" = define ; then
-     timeincl="/usr/include/time.h"
- fi
- if $test "$i_systime" = define ; then
-     timeincl="$timeincl /usr/include/sys/time.h"
- fi
- $cat $timeincl /dev/null | $cppstdin $cppminus > try.c 2>&1
- if $contains 'tz_minuteswest' try.c > /dev/null 2>&1 ; then
-     echo "You have tz_minuteswest defined in $timeincl rather than timezone."
-     d_tz_min="$define"
- else
-     echo "You have timezone defined in $timeincl rather than tz_minuteswest."
-     d_tz_min="$undef"
- fi
-
- #     try alternate test for nm commands that have problems
- #     with data items being parsed
-
-
- if Cppsym ultrix ; then
-     echo "running Ultrix, will not test for tzname in $timeincl"
- else
-     if $test "$d_tzname" = "$undef"; then
-       if $contains tzname try.c >/dev/null 2>&1 ; then
-           echo "tzname found in $timeincl"
-           d_tzname="$define"
-       fi
-     fi
- fi
-
- $rm -f try.c
 : check for valid reply/to fields
 case "$d_useembed" in
 "$define")    dflt=y;;
--- 3854,3859 ----
***************
*** 4018,4023 ****
--- 3926,3996 ----
               ;;
 *)            d_usegetdom="$undef";;
 esac;
+ : see if we should include time.h, sys/time.h, or both
+ cat <<'EOM'
+
+ Testing to see if we should include <time.h>, <sys/time.h> or both.
+ I'm now running the test program...
+ EOM
+ $cat >try.c <<'EOCP'
+ #ifdef I_TIME
+ #include <time.h>
+ #endif
+ #ifdef I_SYSTIME
+ #ifdef SYSTIMEKERNEL
+ #define KERNEL
+ #endif
+ #include <sys/time.h>
+ #endif
+ main()
+ {
+     struct tm foo;
+ #ifdef S_TIMEVAL
+     struct timeval bar;
+ #endif
+     if (foo.tm_sec == foo.tm_sec)
+       exit(0);
+ #ifdef S_TIMEVAL
+     if (bar.tv_sec == bar.tv_sec)
+       exit(0);
+ #endif
+     exit(1);
+ }
+ EOCP
+ flags=''
+ for s_timeval in '-DS_TIMEVAL' ''; do
+     for d_systimekernel in '' '-DSYSTIMEKERNEL'; do
+       for i_time in '-DI_TIME' ''; do
+           for i_systime in '-DI_SYSTIME' ''; do
+               case "$flags" in
+               '') echo "Trying $i_time $i_systime $d_systimekernel $s_timeval"
+                   if $cc $ccflags $i_time $i_systime $d_systimekernel $s_timeval \
+                           try.c -o try >/dev/null 2>&1 ; then
+                       set X $i_time $i_systime $d_systimekernel $s_timeval
+                       shift
+                       flags="$*"
+                       echo "Succeeded with $flags"
+                   fi
+                   ;;
+               esac
+           done
+       done
+     done
+ done
+ case "$flags" in
+ *SYSTIMEKERNEL*) d_systimekernel="$define";;
+ *) d_systimekernel="$undef";;
+ esac
+ case "$flags" in
+ *I_TIME*) i_time="$define";;
+ *) i_time="$undef";;
+ esac
+ case "$flags" in
+ *I_SYSTIME*) i_systime="$define";;
+ *) i_systime="$undef";;
+ esac
+ $rm -f try.c try
+
 : see if utime.h is in includepath
 echo " "
 i_utime=`loc utime.h "" /usr/include $includepath`
***************
*** 4049,4054 ****
--- 4022,4030 ----
           if $test "`/bin/universe`" = "att" ; then
               d_utimbuf="$undef"
               echo "I will use my 'utimbuf' structure..."
+           else
+               d_utimbuf="$define"
+               echo "You have the 'utimbuf' structure..."
             fi
       else
         if $test "$d_utimbuf" != "$define"; then
***************
*** 4133,4138 ****
--- 4109,4125 ----
       i_memory="$undef"
 fi

+ : see if stdarg.h is in includepath
+ echo " "
+ i_stdarg=`loc stdarg.h "" /usr/include $includepath`
+ if $test -n "$i_stdarg"; then
+       echo "Found <stdarg.h>"
+       i_stdarg="$define"
+ else
+       echo "Did not find <stdarg.h>"
+       i_stdarg="$undef"
+ fi
+
 : see if unistd.h is in includepath
 echo " "
 i_unistd=`loc unistd.h "" /usr/include $includepath`
***************
*** 4628,4633 ****
--- 4615,4723 ----
 else
     use_pmake=n
 fi
+ : figure out timezone handling
+
+ # timezone handling part 1 of 4 - setup test files
+ cp ../lib/get_tz.c try.c 2>/dev/null \
+       || $echo "Oh no!  I cannot find the \"lib/get_tz.c\" file."
+ cat >defs.h <<EOF
+ #$i_time I_TIME
+ #$i_systime I_SYSTIME
+ #include <stdio.h>
+ #include <sys/types.h>
+ int get_tz_mins();
+ char *get_tz_name();
+ #ifdef TEST_FOR_TZMINS
+ #define TZNAME_USE_TZNAME
+ #ifdef tzname
+ # undef tzname
+ #endif
+ #define tzname tzfoo
+ char *tzfoo[] = { "FOO", "BAR" };
+ main() { printf("%d\n", get_tz_mins((struct tm *)0)); exit(0); }
+ #else
+ main() { printf("%s\n", get_tz_name((struct tm *)0)); exit(0); }
+ #endif
+ EOF
+
+ # timezone handling part 2 of 4 - timezone offsets configuration
+ $echo " "
+ it_worked=0
+ if $test -f try.c ; then
+     $echo "Trying to figure out how to get timezone offsets."
+     dflt_handling=$tzmins_handling
+     for tzmins_handling in DFLT TM_TZADJ TM_GMTOFF TZAZ_GLOBAL TZ_GLOBAL \
+           FTIME TIMEOFDAY ERROR ; do
+       case "$tzmins_handling" in
+           DFLT)               tzmins_handling=$dflt_handling ;;
+           ERROR)              tzmins_handling=$dflt_handling ; break ;;
+           $dflt_handling)     tzmins_handling= ;;
+       esac
+       $test "$tzmins_handling" = "" && continue
+       $echo "Trying -DTZMINS_USE_$tzmins_handling"
+       $cc -DTZMINS_USE_$tzmins_handling -DTEST_FOR_TZMINS \
+               $ccflags try.c -o try >/dev/null 2>&1 || continue
+       ./try >try.out 2>&1 || continue
+       $echo "Alright!  That seems to have worked."
+       dflt=y
+       rp="Are you `cat try.out` mins west of the prime meridian? [$dflt]"
+       $echo $n "$rp $c"
+       . myread
+       case "$ans" in
+               N*|n*)  $echo "OK...I'll keep trying." ;;
+               *)      it_worked=1 ; break ;;
+       esac
+     done
+ fi
+ if $test $it_worked -ne 1 ; then
+     $echo "I cannot figure out how to get timezone offsets."
+     if $test "$tzmins_handling" != "" ; then
+       $echo "You said \"$tzmins_handling\" worked last time so I'll use that."
+     else
+       $echo "You are going to have to manually set \"tzmins_handling\"."
+     fi
+ fi
+
+ # timezone handling part 3 of 4 - timezone names configuration
+ $echo " "
+ it_worked=0
+ if $test "$tzmins_handling" != "" -a -f try.c ; then
+     $echo "Trying to figure out how to get timezone names."
+     dflt_handling=$tzname_handling
+     for tzname_handling in DFLT TM_NAME TM_ZONE TZNAME TIMEZONE ERROR ; do
+       case "$tzname_handling" in
+           DFLT)               tzname_handling=$dflt_handling ;;
+           ERROR)              tzname_handling=$dflt_handling ; break ;;
+           $dflt_handling)     tzname_handling= ;;
+       esac
+       $test "$tzname_handling" = "" && continue
+       $echo "Trying -DTZNAME_USE_$tzname_handling"
+       $cc -DTZMINS_USE_$tzmins_handling -DTZNAME_USE_$tzname_handling \
+               $ccflags try.c -o try >/dev/null 2>&1 || continue
+       ./try >try.out 2>&1 || continue
+       $echo "Alright!  That seems to have worked."
+       dflt=y
+       rp="Is \"`cat try.out`\" your local timezone name? [$dflt]"
+       $echo $n "$rp $c"
+       . myread
+       case "$ans" in
+               N*|n*)  $echo "OK...I'll keep trying." ;;
+               *)      it_worked=1 ; break ;;
+       esac
+     done
+ fi
+ if $test $it_worked -ne 1 ; then
+     $echo "I cannot figure out how to get timezone names."
+     if $test "$tzname_handling" != "" ; then
+       $echo "You said \"$tzname_handling\" worked last time so I'll use that."
+     else
+       $echo "You are going to have to manually set \"tzname_handling\"."
+     fi
+ fi
+
+ # timezone handling part 4 of 4 - cleanup
+ $rm -f defs.h try.c try.o try try.out
+

 : the "config.over" file can be used to patch configuration changes
 if test -f ../config.over ; then
***************
*** 4753,4762 ****
 execmail='$execmail'
 libswanted='$libswanted'
 c_date='$c_date'
- d_altcheck='$d_altcheck'
 d_ascii='$d_ascii'
 d_calendar='$d_calendar'
 calendar='$calendar'
 d_content='$d_content'
 d_crypt='$d_crypt'
 cryptlib='$cryptlib'
--- 4843,4853 ----
 execmail='$execmail'
 libswanted='$libswanted'
 c_date='$c_date'
 d_ascii='$d_ascii'
+ d_broke_ctype='$d_broke_ctype'
 d_calendar='$d_calendar'
 calendar='$calendar'
+ d_chown_neg1='$d_chown_neg1'
 d_content='$d_content'
 d_crypt='$d_crypt'
 cryptlib='$cryptlib'
***************
*** 4797,4803 ****
 d_newauto='$d_newauto'
 d_noaddfrom='$d_noaddfrom'
 d_usedomain='$d_usedomain'
- d_nocheckvalid='$d_nocheckvalid'
 d_noxheader='$d_noxheader'
 d_pidcheck='$d_pidcheck'
 d_ptem='$d_ptem'
--- 4888,4893 ----
***************
*** 4831,4838 ****
 tempnamc='$tempnamc'
 d_termio='$d_termio'
 d_termios='$d_termios'
- d_tz_min='$d_tz_min'
- d_tzname='$d_tzname'
 d_useembed='$d_useembed'
 d_utimbuf='$d_utimbuf'
 d_vfork='$d_vfork'
--- 4921,4926 ----
***************
*** 4844,4849 ****
--- 4932,4938 ----
 mydomain='$mydomain'
 autohostname='$autohostname'
 i_memory='$i_memory'
+ i_stdarg='$i_stdarg'
 i_stdlib='$i_stdlib'
 i_time='$i_time'
 i_systime='$i_systime'
***************
*** 4893,4898 ****
--- 4982,4989 ----
 shsharp='$shsharp'
 sharpbang='$sharpbang'
 tmpdir='$tmpdir'
+ tzmins_handling='$tzmins_handling'
+ tzname_handling='$tzname_handling'
 use_pmake='$use_pmake'
 xencf='$xencf'
 xenlf='$xenlf'

Index: MANIFEST
*** ../elm2.4/MANIFEST  Sun Jun  6 14:24:46 1993
--- MANIFEST    Tue Aug  3 15:20:41 1993
***************
*** 91,96 ****
--- 91,97 ----
 lib/expand.c
 lib/figadrssee.c
 lib/gcos_name.c
+ lib/get_tz.c
 lib/getaddrfrm.c
 lib/getarpdate.c
 lib/getfullnam.c
***************
*** 119,124 ****
--- 120,126 ----
 lib/realfrom.c
 lib/remfirstwd.c
 lib/reverse.c
+ lib/rfc822tlen.c
 lib/safemalloc.c
 lib/shiftlower.c
 lib/strfcpy.c

Index: Patchlist
*** ../elm2.4/Patchlist Sun Jun  6 14:24:46 1993
--- Patchlist   Sun Sep 19 19:48:55 1993
***************
*** 1,4 ****
--- 1,285 ----
 =========================================================
+ Patch Set - Patches 23a through 23d: Sun Sep 19 19:48:31 EDT 1993
+ Elm 2.4PL22 -> Elm 2.4PL23
+
+ Write options to elmrc even if their values are empty strings.
+ Rationalize code that reads and writes weedouts and alternates.
+ From: chip%[email protected]
+
+ Correct problem in fetch_alias() with alias record fixup that caused
+ core dump on machines with pointers larger than int.  This problem
+ was reported on comp.mail.elm by Richard Eckman and Jim Brown.  Simplify
+ get_one_alias() by having it use fetch_alias().
+
+ break_down_tolist() tried to blindly split address lists at "," which
+ caused bogus results with addreses that had a comma inside a comment
+ or quoted text, such as "user@domain (Last, First)".  This patch steps
+ through the address in quanta of RFC-822 tokens when searching for a
+ delimiting comma.  It also adds "rfc822_toklen()" to the library to
+ get that length.
+ From: [email protected] (Chip Rosenthal)
+
+ This fixes a bug in the MIME code.  Include_Part() uses expand_env()
+ to expand the include file name, but since expand_env() is destructive
+ [it uses strtok()] the file name gets corrupted, and the "Content-Name"
+ header can contain a bogus value.  The easy fix would be a one-line
+ hack to Include_Part to use a temporary buffer.  This patch does not
+ implement the easy fix.  *Every* place expand_env() is used, its side
+ effects cause problems.  I think the right fix is to make expand_env()
+ non-destructive (i.e. have it duplicate the input to a temporary buffer
+ and work from there).  The attached patch modifies expand_env() in
+ that manner, and eliminates all of the `copy to a temporary buffer'
+ calls that precede it throughout elm.
+ From: [email protected] (Chip Rosenthal)
+
+ I have been repetedly crashing elm 2.4.22 until I discovered that a
+ test for failing to open the system elmrc file is mising. This could
+ usefully be added in read_rc.c. Version info and patch follows:
+ From: "C.R. Ritson" <[email protected]>
+
+ Greatly simplified "lib/striparens.c" to use new rfc822_toklen() routine.
+ This cut more than 50% out of the object size.  Also added _TEST case.
+ From: [email protected] (Chip Rosenthal)
+
+ When resyncing aliases from elm, and there was aliases to delete,
+ the alias.pag file could be corrupted since file_offset wasn't set to zero.
+ From: [email protected] (Jan Djarv)
+
+ A long-standing bug of handling replies to VMS systems.
+ Original "From: " -line is of format:
+       From: "NAME \"Real Name\"" <USERNAME@vms-system>
+ (PMDF mailer)
+       Anyway,  parse_arpa_who()  strips quotes too cleanly
+ resulting data:
+       NAME \"Real Name\
+ which, when put into parenthesis, becomes:
+       (NAME \"Real Name\)
+ which in its turn lacks closing `)'
+ Patch of  lib/parsarpwho.c  fixes that.
+ strtokq() started one position too late to search for next double-quote (") char.
+ Another one-off (chops off trailing comment character, quote or not..)  in   src/reply.c
+ From: Matti Aarnio <[email protected]>
+
+ Three changes to expand_env() in src/read_rc.c:  make it non-destructive,
+ have it return an error code instead of bailing out, and add a buffer
+ size argument to avoid overwritting the destination.  The first is to
+ avoid all of the gymnastics Elm needed to go through (and occasionally
+ forgot to go through) to protect the value handed to expand_env().
+ The second is because expand_env() was originally written to support
+ "elmrc" and bailing out was a reasonable thing to do there -- but not
+ in the other places where it has since been used.  The third is just
+ a matter of practicing safe source code.
+
+ This patch changes all invocations to expand_env() to eliminate making
+ temporary copies (now that the routine is non-destructive) and to pass
+ in a destination length.  Since expand_env() no longer bails out on
+ error, a do_expand_env() routine was added to src/read_rc.c handle
+ this.  Moreover, the error message now gives some indication of what
+ the problem is rather than just saying "can't expand".
+
+ Gratitous change to src/editmsg.c renaming filename variables to
+ clarify the purpose.
+ From: [email protected] (Chip Rosenthal)
+
+ [ Patch description ]
+ Update the example elmrc and move a couple out of order variable
+ descriptions.
+ From: [email protected] (Dave Wolfe)
+
+ Handle reply-to in batch mode.
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ In fastmail, if environment variable $REPLYTO is set, use it as
+ default Reply-To.  Also, eliminate unnecessary strlen() calls.
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ Support aliases both on 64 bit and 32 bit machines at the same time.
+ From: Dan Mosedale <[email protected]>
+
+ Spaces in weedout strings wasn't preserved ("From " became "From").
+ From: [email protected] (Jan Djarv)
+
+ Added text about how the weedout list works w.r.t From: and From_
+ From: [email protected] (Jan Djarv)
+
+ default_weedlist() can't use pmalloc, because weedout() calls free when
+ it encounters *clear-weed-list*.
+ From: [email protected] (Jan Djarv)
+
+ The NLS messages for elm -h output didn't have the -i or -t options.
+ From: [email protected] (Jan Djarv)
+
+ The message CannotInitErrorExpanding was called CantExpandEnvVar in s_elm.m.
+ Change it for consistency.
+ From: [email protected] (Jan Djarv)
+
+ Since it was not intended that varargs.h and stdarg.h were
+ included simultaneously there may be colliding definitions
+ on some systems if you use a standard C compiler. If both
+ of these headers are included the compiler has no way to
+ know which definitions to use.
+ From: Jukka Ukkonen <[email protected]>
+
+ "*clear-weed-list*" in elmrc was wiped out when one saved the options in elm.
+ From: [email protected] (Jan Djarv)
+
+ When STDC is used on Convex the feof() function is defined as
+ a true library routine in the header files and moreover the
+ library routine also leaks royally. It returns always 1!!
+ So we have to use a macro. Convex naturally does not provide
+ you with one though if you are using a STDC compiler. So we
+ have to include one.
+ From: Jukka Ukkonen <[email protected]>
+
+ Removed bogus string lockfile.
+ From: [email protected] (Jan Djarv)
+
+ The last character of a form field gets zapped if more characters than
+ the field expects are entered.
+ From: [email protected] (Dave Wolfe)
+
+ Patch for Elm 2.4 PL22 to correct handling of SIGWINCH signals on
+ DecStations with Ultrix 4.2.
+ The problem was that elm running in an xterm exits silently when the
+ window is resize. This was caused by incorrect signal handling for BSD.
+ From: [email protected]
+
+ Implement new timezone handling.  New file lib/get_tz.c with new timezone
+ routines.  Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
+ definitions.  Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
+ definitions.  Updated Configure.  Modified lib/getarpdate.c and
+ lib/strftime.c to use new timezone routines.
+ From: [email protected] (Chip Rosenthal)
+
+ Add proper casts to free() calls to suppress warnings.
+ Properly cast return types.
+ From: [email protected] (Chip Rosenthal)
+
+ Added -d option to elmalias.
+ From: [email protected] (Jan Djarv)
+
+ Elm tries to replace the system toupper() and tolower() on current
+ BSD systems, which is unnecessary.  Even worse, the replacements
+ collide during linking with routines in isctype.o.  This patch adds
+ a Configure test to determine whether replacements are really needed
+ (BROKE_CTYPE definition).  The <ctype.h> header file is now included
+ globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ there.  Inclusion of <ctype.h> was removed from *all* the individual
+ files, and the toupper() and tolower() routines in lib/opt_utils.c
+ were dropped.
+ From: [email protected] (Chip Rosenthal)
+
+ Fix signal type for 386bsd
+ From: Scott Mace <[email protected]>
+
+ When an environment variable was given as the tmpdir definition the src
+ and dest overlapped in expand_env.  This made elm produce a garbage
+ expansion because expand_env cannot cope with overlapping src and
+ dest.  I added a new variable raw_temp_dir to keep src and dest not to
+ overlap.
+ From: Jukka Ukkonen <[email protected]>
+
+ I compiled elm 2.4.22 with Purify 2 and fixed some memory leaks and
+ some reads of unitialized memory.
+ From: [email protected]
+
+ A change to answer:s mail command to be like those of elm and filter.
+ From: [email protected] (Jan Djarv)
+
+ Elm was failing to write an empty "alternatives" list to elmrc.
+ From: [email protected] (Chip Rosenthal)
+
+ Usage message for elmalias changed.
+ From: [email protected] (Jan Djarv)
+
+ Correct typo and use hard spaces within quotes in *clear-weed-list* note.
+ From: [email protected] (Dave Wolfe)
+
+ fix where checkalias doesn't fully expand multi-database aliases
+ From: Steve Wolf <[email protected]>
+
+ The macro ctrl(c) did not work correctly for a DEL character
+ neither did it make the backward mapping from a control char
+ to the letter that is normally used with an up-arrow prefix
+ to represent the control character.
+ From: Jukka Ukkonen <[email protected]>
+
+ Don't declare _exit() if <unistd.h> already did it.
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ The ANSI version of varargs is "stdarg", not "stdargs".
+ From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+
+ Added some documentation for textencoding variable.
+ From: [email protected] (Jan Djarv)
+
+ more purify found errors
+ From: [email protected]
+
+ Add missing parens
+ From: [email protected] (Dave Wolfe)
+
+ Fix problem where deleting to previous line caused duplication due to the
+ file being opened for append (in append mode, all writes are to the end of
+ file regardless of the file pointer).
+ From: [email protected] (Paul Close)
+
+ have Writechar() backspace over the left edge of the screen to the end
+ of the previous line if the current line is not the first line on the
+ screen.
+ From: Jukka Ukkonen <[email protected]>
+
+ Call to expand_env for pager should be call to do_expand_env.
+ temp_dir not initialized.
+ From: [email protected] (Jan Djarv)
+
+ Try splitting chown into two calls to set group on systems where
+ chown of owner is restricted.
+ From: Syd
+
+ strtokq was called with the wrong number of parameters.
+ From: [email protected] (Jan Djarv)
+
+ Add ability for elmalias to determine HOME if missing from the environment.
+ From: [email protected] (Chip Rosenthal)
+
+ Changed a few buffers from LONG_STRING (512) to VERY_LONG_STRING
+ to avoid long header lines overflowing the allocated space. At
+ least 1024 bytes should be allowed in any header line/field.
+ From: Jukka Ukkonen <[email protected]>
+
+ Here's some more patch stuff for undersize buffers for header lines.
+ From: Jukka Ukkonen <[email protected]>
+
+ Fix a code portability problem with Convex.
+ From: Jukka Ukkonen <[email protected]>
+
+ I found a few places more where the code was missing a call
+ to fflush() before it called unlock() and fclose()/exit()
+ right after unlocking the mail drop.
+ From: Jukka Ukkonen <[email protected]>
+
+ Erroneous Content-Length:s that ended up beyond the end of the folder
+ wasn't checked for, so the rest of the folder became one big message.
+ From: [email protected] (Jan Djarv)
+
+ expand() didn't read the global rc file if the user elmrc didn't exist or
+ didn't have an entry for maildir.
+ From: [email protected] (Jan Djarv)
+
+ Conform textencoding addition to style standard.
+ From: [email protected] (Dave Wolfe)
+
+ Although it doesnt solve the limit/resync problem of new
+ messages, allow them to be accessed anyway.
+ From: [email protected]
+
+
+
+ =========================================================
 Patch Set - Patches 22 through 22: Sun Jun  6 14:09:37 EDT 1993
 Elm 2.4PL21 -> Elm 2.4PL22


Index: config.h.SH
*** ../elm2.4/config.h.SH       Sat May  8 15:41:40 1993
--- config.h.SH Sun Sep 26 21:43:42 1993
***************
*** 107,123 ****
  */
 #define               CONFIGURE_DATE  "$c_date"

- /* ALTCHECK:
-  *    This symbol, if defined, means that altzone exists.
-  */
- #$d_altcheck ALTCHECK         /**/
-
 /* ASCII_CTYPE:
  *    This symbol, if defined, indicates that the ctype functions and
  *    macros are ASCII specific and not 8-bit clean.
  */
 #$d_ascii     ASCII_CTYPE     /**/

 /* ENABLE_CALENDAR:
  *    This symbol, if defined, indicates that the calendar feature
  *    should be supported.
--- 107,124 ----
  */
 #define               CONFIGURE_DATE  "$c_date"

 /* ASCII_CTYPE:
  *    This symbol, if defined, indicates that the ctype functions and
  *    macros are ASCII specific and not 8-bit clean.
  */
 #$d_ascii     ASCII_CTYPE     /**/

+ /* BROKE_CTYPE:
+  *    This symbol, if defined, indicates that toupper and tolower
+  *    routines/macros are not safe to use.
+  */
+ #$d_broke_ctype       BROKE_CTYPE     /**/
+
 /* ENABLE_CALENDAR:
  *    This symbol, if defined, indicates that the calendar feature
  *    should be supported.
***************
*** 125,130 ****
--- 126,135 ----
 #$d_calendar  ENABLE_CALENDAR /**/
 #define dflt_calendar_file    "$calendar"

+ /* CHOWN_NEG1:
+  */
+ #$d_chown_neg1        CHOWN_NEG1      /**/
+
 /* DONT_ESCAPE_MESSAGES:
  *    This symbol, if defined, indicates that a binary capable MTA is in use
  *    that honors the content-length header and no message constructs need
***************
*** 307,319 ****
  *    This symbol, if defined, indicates that elm should add
  *    the domain name to our address
  */
- /* NOCHECK_VALIDNAME:
-  *    This symbol, if defined, indicates that elm should not
-  *    check the addresses against mailboxes on this system.
-  */
 #$d_noaddfrom DONT_ADD_FROM /**/
 #$d_usedomain USE_DOMAIN /**/
- #$d_nocheckvalid NOCHECK_VALIDNAME    /**/

 /* NO_XHEADER:
  *    This symbol, if defined, will not automatically add "X-Mailer:"
--- 312,319 ----
***************
*** 469,485 ****

 #$d_termio    TERMIO          /**/

- /* TZ_MINUTESWEST:
-  *    This symbol is defined if this system uses tz_minutes west
-  *    in time.h instead of timezone.  Only for BSD Systems
-  */
- /* TZNAME:
-  *    This symbol, if defined, indicates that extern char *tzname[] exists.
-  */
- #$d_tz_min    TZ_MINUTESWEST  /**/
-
- #$d_tzname    TZNAME  /**/
-
 /* USE_EMBEDDED_ADDRESSES:
  *    This symbol, if defined, indicates that replyto: and from:
  *    headers can be trusted.
--- 469,474 ----
***************
*** 528,533 ****
--- 517,528 ----
  */
 #$i_memory    I_MEMORY        /**/

+ /* I_STDARG:
+  *    This symbol, if defined, indicates that the file stdarg.h
+  *    should be included instead of varargs
+  */
+ #$i_stdarg    I_STDARG        /**/
+
 /* I_STDLIB:
  *    This symbol, if defined, indicates that the file stdlib.h
  *    should be included instead of declaring the stdlib routines.
***************
*** 588,593 ****
--- 583,607 ----
  */
 #define       SIGHAND_TYPE    $sigtype

+ /* TZMINS_USE_xxxxxx:
+  *    Specify how to get timezone offset.  Possible values are:
+  *             TZMINS_USE_TM_TZADJ    use (struct tm *)->tm_tzadj
+  *             TZMINS_USE_TM_GMTOFF   use (struct tm *)->tm_gmtoff
+  *             TZMINS_USE_TZAZ_GLOBAL use "timezone, altzone" externals
+  *             TZMINS_USE_TZ_GLOBAL   use "timezone" external
+  *             TZMINS_USE_FTIME       use ftime() function
+  *             TZMINS_USE_TIMEOFDAY   use gettimeofday() function
+  */
+ /* TZNAME_USE_xxxxxx:
+  *    Specify how to get timezone name.  Possible values are:
+  *             TZNAME_USE_TM_NAME     use (struct tm *)->tm_name
+  *             TZNAME_USE_TM_ZONE     use (struct tm *)->tm_zone
+  *             TZNAME_USE_TZNAME      use "tzname[]" external
+  *             TZNAME_USE_TIMEZONE    use timezone() function
+  */
+ #define TZMINS_USE_$tzmins_handling
+ #define TZNAME_USE_$tzname_handling
+
 /* XENIX:
  *    This symbol, if defined, indicates this is a Xenix system,
  *    for knocking  out the far keyword in selected places.

Index: doc/Alias.guide
Prereq: 5.5
*** ../elm2.4/doc/Alias.guide   Sun Apr 11 21:45:22 1993
--- doc/Alias.guide     Mon Jul 19 23:02:25 1993
***************
*** 1,4 ****
! .\" @(#)$Id: Alias.guide,v 5.5 1993/04/12 01:45:22 syd Exp $
 .\"
 .\"  A guide to the ELM alias system and so on.
 .\"  format with:
--- 1,4 ----
! .\" @(#)$Id: Alias.guide,v 5.7 1993/07/20 03:02:11 syd Exp $
 .\"
 .\"  A guide to the ELM alias system and so on.
 .\"  format with:
***************
*** 11,16 ****
--- 11,24 ----
 .\"   Syd Weinstein           [email protected] (dsinc!elm)
 .\"
 .\"  $Log: Alias.guide,v $
+ .\" Revision 5.7  1993/07/20  03:02:11  syd
+ .\" drop useless reference to Elm address validation
+ .\" From: Syd
+ .\"
+ .\" Revision 5.6  1993/07/20  02:16:26  syd
+ .\" Explain that newalias for global takes -g argument
+ .\" From: Syd via request from Manfred Ebery
+ .\"
 .\" Revision 5.5  1993/04/12  01:45:22  syd
 .\" Update for quotes
 .\" From: [email protected] (Dave Wolfe)
***************
*** 282,289 ****
 \f2Elm Configuration Guide\f1 for more details on these variables).
 .sp
 Simply create the system alias file in the specified directory
! as you would a normal alias file, and install it the same way (see the
! following section for more details on that).  Voila!!
 .sp
 .hn 1 Editing and Installing New Aliases

--- 290,298 ----
 \f2Elm Configuration Guide\f1 for more details on these variables).
 .sp
 Simply create the system alias file in the specified directory
! as you would a normal alias file, and install it using the newalias
! command with the -g option (see the following section for more details
! on that).  Voila!!
 .sp
 .hn 1 Editing and Installing New Aliases

***************
*** 309,316 ****
 is \*QBut how the heck does this relate to my existing \f2Berkeley Mail\f1
 aliases and the lower-level \f2sendmail\f1 alias system?\*U  Well,
 rest assured that if you \f2really\f1 want to have
! your aliases down in the transport you can.  No problem.  All you'll
! need to do is to turn off the address validation in Elm.
 .sp
 And for those ex-\f2Berkeley Mail\f1 fans, you can translate your
 aliases into the format that Elm wants by running them
--- 318,324 ----
 is \*QBut how the heck does this relate to my existing \f2Berkeley Mail\f1
 aliases and the lower-level \f2sendmail\f1 alias system?\*U  Well,
 rest assured that if you \f2really\f1 want to have
! your aliases down in the transport you can.  No problem.
 .sp
 And for those ex-\f2Berkeley Mail\f1 fans, you can translate your
 aliases into the format that Elm wants by running them

Index: doc/Config.guid
Prereq: 5.8
*** ../elm2.4/doc/Config.guid   Mon Apr 12 00:01:01 1993
--- doc/Config.guid     Thu Jul 29 22:23:26 1993
***************
*** 1,4 ****
! .\" @(#)$Id: Config.guid,v 5.8 1993/04/12 04:00:55 syd Exp $
 .\"
 .\"  A guide to the ELM alias system and so on.
 .\"  format with:
--- 1,4 ----
! .\" @(#)$Id: Config.guid,v 5.9 1993/07/30 02:23:21 syd Exp $
 .\"
 .\"  A guide to the ELM alias system and so on.
 .\"  format with:
***************
*** 11,16 ****
--- 11,19 ----
 .\"   Syd Weinstein           [email protected] (dsinc!elm)
 .\"
 .\"  $Log: Config.guid,v $
+ .\" Revision 5.9  1993/07/30  02:23:21  syd
+ .\" fix -q to -g in newalias call
+ .\"
 .\" Revision 5.8  1993/04/12  04:00:55  syd
 .\" remove unused ALIAS parameters
 .\"
***************
*** 378,384 ****
 then it'll put the current
 mailbox into this file in the user's home directory.
 .lp newalias 1.0i
! How to install new aliases (note that you MUST have the \f3\-q\f1 option!).
 .lp readmsg 1.0i
 What the \f2readmsg\f1 program is installed as.
 .hu Runtime configuration \(em the global \f2$lib/elm.rc\fP file
--- 381,387 ----
 then it'll put the current
 mailbox into this file in the user's home directory.
 .lp newalias 1.0i
! How to install new aliases (note that you MUST have the \f3\-g\f1 option!).
 .lp readmsg 1.0i
 What the \f2readmsg\f1 program is installed as.
 .hu Runtime configuration \(em the global \f2$lib/elm.rc\fP file

Index: doc/Ref.guide
Prereq: 5.25
*** ../elm2.4/doc/Ref.guide     Thu May 13 23:56:40 1993
--- doc/Ref.guide       Sun Sep 19 19:43:36 1993
***************
*** 1,4 ****
! .\" @(#)$Id: Ref.guide,v 5.25 1993/05/14 03:56:39 syd Exp $
 .\"
 .\"  Reference guide to the Elm mail system.
 .\"  format with
--- 1,4 ----
! .\" @(#)$Id: Ref.guide,v 5.30 1993/09/19 23:43:35 syd Exp $
 .\"
 .\"  Reference guide to the Elm mail system.
 .\"  format with
***************
*** 12,17 ****
--- 12,39 ----
 .\"  (C) Copyright 1988-1992 Usenet Community Trust
 .\"
 .\"  $Log: Ref.guide,v $
+ .\" Revision 5.30  1993/09/19  23:43:35  syd
+ .\" Conform textencoding addition to style standard.
+ .\" From: [email protected] (Dave Wolfe)
+ .\"
+ .\" Revision 5.29  1993/08/23  02:53:52  syd
+ .\" Added some documentation for textencoding variable.
+ .\" From: [email protected] (Jan Djarv)
+ .\"
+ .\" Revision 5.28  1993/08/10  21:25:09  syd
+ .\" Correct typo and use hard spaces within quotes in *clear-weed-list* note.
+ .\" From: [email protected] (Dave Wolfe)
+ .\"
+ .\" Revision 5.27  1993/08/03  18:56:24  syd
+ .\" Added text about how the weedout list works w.r.t From: and From_
+ .\" From: [email protected] (Jan Djarv)
+ .\"
+ .\" Revision 5.26  1993/07/20  02:43:05  syd
+ .\" [ Patch description ]
+ .\" Update the example elmrc and move a couple out of order variable
+ .\" descriptions.
+ .\" From: [email protected] (Dave Wolfe)
+ .\"
 .\" Revision 5.25  1993/05/14  03:56:39  syd
 .\" Moved the new numeric variables to the Numeric Variables section and
 .\" applied the quoting/highlight policy to them.
***************
*** 364,377 ****
 \f3charset\f1. Elm tries to know which character set could display US-ASCII
 too, but its list of compatible character sets is probably not complete.

- .lp displaycharset 1.0i
- This is the character set which is supported by your terminal.
- The default depends on your site's installation but is usually
- US-ASCII. For sites with
- .xw
- support, ISO-8859-1
- is a reasonable default.
-
 .lp compatcharsets 1.0i
 This is the list of character sets which are more or less a superset
 of US-ASCII. This enables Elm to display messages with \f3charset\f1=US-ASCII
--- 386,391 ----
***************
*** 440,445 ****
--- 454,467 ----
 .br
 z     Z) signature dashes \f2(sigdashes)\f1

+ .lp displaycharset 1.0i
+ This is the character set which is supported by your terminal.
+ The default depends on your site's installation but is usually
+ US-ASCII. For sites with
+ .xw
+ support, ISO-8859-1
+ is a reasonable default.
+
 .lp easyeditor+ 1.0i
 The editor to be used by the \*Q~e\*U escape within the builtin editor.
 The default value is the value of the configuration variable \f2emacs_editor\f1
***************
*** 693,698 ****
--- 715,739 ----
 itself and affects only their order on the index screen.  The
 default is \f2mailbox\f1 order.

+ .lp textencoding 1.0i
+ This is the value for the
+ \*QContent-Transfer-Encoding:\*U header,
+ which is used to tell MIME
+ (Multipurpose Internet Mail Extension) capable mail readers how they
+ should decode your mail.
+ The default depends on your site's installation, but is usually
+ \f27bit\f1. Other possible values are \f28bit\f1, \f2base64\f1 or
+ \f2quoted-printable\f1 (see RFC1341 for details).
+ \f27bit\f1 and \f28bit\f1 implies no encoding.
+ .sp
+ Note that Elm doesn't look at this value; it is just placed in your
+ outgoing mail headers.
+ If you put \f2base64\f1 or \f2quoted-printable\f1 as the value,
+ Elm will NOT turn your message into a \f2base64\f1/\f2quoted-printable\f1
+ encoded message.  You will have to do that
+ yourself with whatever means are available in your MIME capable mail reader.
+ Metamail, for instance, has a program called mimencode that you can use.
+
 .lp tmpdir 1.0i
 Use this if you want to define your own directory for the temporary
 file Elm creates while running.  This is only necessary if using the
***************
*** 737,744 ****
 \&Status:
 \&X-Mailer:
 .ft 1
- .in 0
 .fi
 .ne 8
 .hu Numeric Variables

--- 778,791 ----
 \&Status:
 \&X-Mailer:
 .ft 1
 .fi
+ .sp
+ .in 1.0i
+ Note that the \*QFrom\*U entry weeds out both \*QFrom:\*U and the
+ \*QFrom\ \*U headers. If you just want to weed out \*QFrom\ \*U, for example,
+ put a \*Q*clear-weed-list*\*U at the start of the list followed by \*QFrom_\*U
+ or \*QFrom\ \*U.
+ .in 0
 .ne 8
 .hu Numeric Variables

***************
*** 941,951 ****
 Set ON to get a copy of mail you send to a mailing list you are on,
 otherwise you do not get a copy of such messages.  The default is OFF.

- .lp names* 1.0i
- Set OFF to display the primary recipients' addresses on your screen
- with their full names when you send a message.  Set ON to display only
- the full names.  The default is ON.
-
 .lp movepage 1.0i
 Set ON to enable commands that move through the folder by pages (see
 the \*q+\*u, \*q\-\*u, \f2<right>\f1, and \f2<left>\f1 keys in section
--- 988,993 ----
***************
*** 953,958 ****
--- 995,1005 ----
 that page of messages.  Set OFF to not alter the current message
 pointer location when moving through pages.  The default is OFF.

+ .lp names* 1.0i
+ Set OFF to display the primary recipients' addresses on your screen
+ with their full names when you send a message.  Set ON to display only
+ the full names.  The default is ON.
+
 .lp noheader 1.0i
 Set ON to not include the headers of messages when copying a message
 into the edit buffer for replying or forwarding (see the \f3autocopy\f1
***************
*** 1068,1074 ****
 .in 0
 .sp
 .sp
! For a better idea of how this all works, here's my \f2.elm/elmrc\f1
 file.  While looking through it, notice that you can have lots of
 comments and blank lines for readability and that you can also use
 \*Qshell variables\*U and the \*q~\*u (tilde) metacharacter for your home
--- 1115,1121 ----
 .in 0
 .sp
 .sp
! For a better idea of how this all works, here's a sample \f2.elm/elmrc\f1
 file.  While looking through it, notice that you can have lots of
 comments and blank lines for readability and that you can also use
 \*Qshell variables\*U and the \*q~\*u (tilde) metacharacter for your home
***************
*** 1082,1088 ****
   #
   # .elm/elmrc \- options file for the ELM mail system
   #
!   # Saved automatically by ELM 2.4 for Dave Taylor
   #

   # For yes/no settings with ?, ON means yes, OFF means no
--- 1129,1135 ----
   #
   # .elm/elmrc \- options file for the ELM mail system
   #
!   # Saved automatically by ELM 2.4 for Elm Development Group
   #

   # For yes/no settings with ?, ON means yes, OFF means no
***************
*** 1091,1110 ****
   calendar = ~/.Agenda

   # what editor to use ("none" means simulate Berkeley Mail)
   editor = none

   # the character to use in the builtin editor for entering commands
   escape = ~

   # the full user name for outbound mail
!   fullname = Dave Taylor

   # where to save received messages to, default file is "=received"
   receivedmail = $HOME/Mail/received

   # where to save my mail to, default directory is "Mail"
!   maildir = /users/taylor/Mail

   # program to use for displaying messages (\'builtin\' is recommended)
   pager = builtin

--- 1138,1161 ----
   calendar = ~/.Agenda

   # what editor to use ("none" means simulate Berkeley Mail)
+   # \'%s\' can be used as the temporary filename for the outgoing message
   editor = none

   # the character to use in the builtin editor for entering commands
   escape = ~

   # the full user name for outbound mail
!   fullname = Elm Development Group

   # where to save received messages to, default file is "=received"
   receivedmail = $HOME/Mail/received

   # where to save my mail to, default directory is "Mail"
!   maildir = /users/elmdev/Mail

+   #directory to hold my temporary files to avoid NFS cross mount problems
+   tmpdir = /users/elmdev/Mail/tmp
+
   # program to use for displaying messages (\'builtin\' is recommended)
   pager = builtin

***************
*** 1114,1121 ****
   # how to print a message (\'%s\' is the filename)
   print = lpr \-Plw2 %s

   # where to save copies of outgoing mail to, default file is "=sent"
!   sentmail = /users/taylor/Mail/mail.sent

   # the shell to use for shell escapes
   shell = /bin/csh
--- 1165,1175 ----
   # how to print a message (\'%s\' is the filename)
   print = lpr \-Plw2 %s

+   # attribution string for replies (\'%s\' is the author of original message)
+   attribution = According to %s:
+
   # where to save copies of outgoing mail to, default file is "=sent"
!   sentmail = /users/elmdev/Mail/mail.sent

   # the shell to use for shell escapes
   shell = /bin/csh
***************
*** 1129,1140 ****
   # do we want dashes above signatures? (News 2.11 compatibility and convention)
   sigdashes = ON

!   # how to sort folders, "Mailbox" by default
   sortby = Reverse\-Received

-   # how to sort the alias list, "Name" by default
-   aliassortby = Name
-
   # should the default be to delete messages we\'ve marked for deletion?
   alwaysdelete = ON

--- 1183,1191 ----
   # do we want dashes above signatures? (News 2.11 compatibility and convention)
   sigdashes = ON

!   # how to sort folders, "Reverse Sent" by default
   sortby = Reverse\-Received

   # should the default be to delete messages we\'ve marked for deletion?
   alwaysdelete = ON

***************
*** 1175,1181 ****

   # should we display the three\-line \'mini\' menu?
   menu = ON
!   # would you like a copy of a message you send to an alias you are on???
   metoo = OFF

   # when using the page commands (+ \- <NEXT> <PREV>) change the current
--- 1226,1233 ----

   # should we display the three\-line \'mini\' menu?
   menu = ON
!
!   # would you like a copy of a message you send to an alias you are on?
   metoo = OFF

   # when using the page commands (+ \- <NEXT> <PREV>) change the current
***************
*** 1233,1239 ****

   # alternative addresses that I could receive mail from (usually a
   # forwarding mailbox) and don\'t want to have listed...
!   alternatives = hplabs!taylor  hpldat!taylor  taylor@hplabs  taylor%hpldat
 .fi
 .br
 .ne 5
--- 1285,1323 ----

   # alternative addresses that I could receive mail from (usually a
   # forwarding mailbox) and don\'t want to have listed...
!   alternatives = dsidev!elmdev  dsirel!elmdev  elmdev@dsidev  elmdev%dsidev
!
!   # list of delivery precedences allowed, or empty to allow anything
!   # precedence may be followed by optional ":priority" specification
!   precedences = special\-delivery:urgent air\-mail:urgent first\-class bulk junk
!
!   # name of Character Set used with MIME text/plain Content\-type
!   # US\-ASCII is default. Be aware that if you use a national charset
!   # elm probably needs metamail to display US\-ASCII. Elm tries to
!   # know if that charset could display US\-ASCII too, but the list
!   # of us\-ascii compatible charsets is not yet complete
!   charset=US\-ASCII
!
!   # name of Character Set which the display supports. This is independent
!   # of the above "charset".
!   displaycharset=US\-ASCII
!
!   # list of Character Sets, which are more or less a superset of US\-ASCII
!   # so we know that we can display messages with charset=US\-ASCII without
!   # help of metamail
!   compatcharsets = ISO\-8859\-1 ISO\-8859\-2 ISO\-8859\-3 ISO\-8859\-4 ISO\-8859\-5 ISO\-8859\-6 ISO\-8859\-7 ISO\-8859\-8 ISO\-8859\-9
!
!   # would you like to use termcap/terminfo ti/te entries?
!   usetite = ON
!
!   # Value by which message count is incremented while reading a new mailbox.
!   # Setting this value to a number larger than one will speed up the time it
!   # takes to read a large mailbox when using a slow terminal.
!   readmsginc = 5
!
!   # time in seconds which Elm will wait after displaying a transient message
!   # and before erasing it.  Can be 0 or positive integer.
!   sleepmsg = 2
 .fi
 .br
 .ne 5

Index: doc/elmalias.1
*** ../elm2.4/doc/elmalias.1    Sun Apr 11 22:11:17 1993
--- doc/elmalias.1      Tue Aug  3 15:23:12 1993
***************
*** 10,16 ****
 .SH SYNOPSIS
 .B elmalias
 [
! .B \-aenrsuvV
 ] [
 .B \-f
 format ] [ name  ... ]
--- 10,16 ----
 .SH SYNOPSIS
 .B elmalias
 [
! .B \-adenrsuvV
 ] [
 .B \-f
 format ] [ name  ... ]
***************
*** 91,96 ****
--- 91,103 ----
 Selects an alternative output format.  The ``Alias'' information is
 displayed in addition to and preceding the usual ``Address'' information.
 .\"
+ .\"
+ .\"
+ .IP \fB\-d\fP
+ Turns debugging on. Has no effect unless
+ .I elmalias
+ was compiled with debugging enabled.
+ .\"
 .\"
 .\"
 .IP \fB\-e\fP

Index: doc/elmrc-info
Prereq: 5.9
*** ../elm2.4/doc/elmrc-info    Sun Jun  6 14:24:47 1993
--- doc/elmrc-info      Sun Aug 22 22:53:55 1993
***************
*** 1,4 ****
! #@(#)$Id: elmrc-info,v 5.9 1993/06/06 17:50:52 syd Exp $
 # Elm Version 2.4
 # For yes/no settings with ?, ON means yes, OFF means no

--- 1,4 ----
! #@(#)$Id: elmrc-info,v 5.10 1993/08/23 02:53:52 syd Exp $
 # Elm Version 2.4
 # For yes/no settings with ?, ON means yes, OFF means no

***************
*** 232,234 ****
--- 232,239 ----
 sleepmsg
 # time in seconds which Elm will wait after displaying a transient message
 # and before erasing it.  Can be 0 or positive integer.
+
+ textencoding
+ # Type of encoding to be put into the MIME Content-Transfer-Encoding header.
+ # Usual values are 7bit or 8bit.
+ # NOTE: Elm will not encode your message based on this variable.

Index: filter/actions.c
Prereq: 5.6
*** ../elm2.4/filter/actions.c  Tue Apr 20 21:25:46 1993
--- filter/actions.c    Tue Aug  3 15:28:40 1993
***************
*** 1,8 ****

! static char rcsid[] ="@(#)$Id: actions.c,v 5.6 1993/04/21 01:25:45 syd Exp $";

 /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  *
  *                    Copyright (c) 1988-1992 USENET Community Trust
  *                    Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----

! static char rcsid[] ="@(#)$Id: actions.c,v 5.8 1993/08/03 19:28:39 syd Exp $";

 /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  *
  *                    Copyright (c) 1988-1992 USENET Community Trust
  *                    Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,35 ----
  *
  *******************************************************************************
  * $Log: actions.c,v $
+  * Revision 5.8  1993/08/03  19:28:39  syd
+  * Elm tries to replace the system toupper() and tolower() on current
+  * BSD systems, which is unnecessary.  Even worse, the replacements
+  * collide during linking with routines in isctype.o.  This patch adds
+  * a Configure test to determine whether replacements are really needed
+  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
+  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+  * there.  Inclusion of <ctype.h> was removed from *all* the individual
+  * files, and the toupper() and tolower() routines in lib/opt_utils.c
+  * were dropped.
+  * From: [email protected] (Chip Rosenthal)
+  *
+  * Revision 5.7  1993/08/03  19:07:58  syd
+  * Removed bogus string lockfile.
+  * From: [email protected] (Jan Djarv)
+  *
  * Revision 5.6  1993/04/21  01:25:45  syd
  * I'm using Elm 2.4.21 under Linux.  Linux has no Bourne shell.  Each
  * user installs her favorite shell as /bin/sh.  I use Bash 1.12.
***************
*** 61,67 ****

 #include <stdio.h>
 #include <pwd.h>
- #include <ctype.h>
 #include <fcntl.h>

 #include "defs.h"
--- 77,82 ----
***************
*** 83,89 ****

       FILE *pipefd, *tempfd, *mailfd;
       int  in_header = TRUE, line_count = 0, mailunit, pid, statusp;
!       char tempfile[SLEN], mailbox[SLEN], lockfile[SLEN],
            buffer[VERY_LONG_STRING], *cp;

       if (verbose && ! log_actions_only && outfd != NULL)
--- 98,104 ----

       FILE *pipefd, *tempfd, *mailfd;
       int  in_header = TRUE, line_count = 0, mailunit, pid, statusp;
!       char tempfile[SLEN], mailbox[SLEN],
            buffer[VERY_LONG_STRING], *cp;

       if (verbose && ! log_actions_only && outfd != NULL)
***************
*** 209,220 ****
           if (outfd != NULL) {
             fprintf(outfd, catgets(elm_msg_cat,FilterSet,
                                    FilterCouldntCreateLockFile,
!                    "filter (%s): Couldn't create lock file %s\n"),
!                   date_n_user(), lockfile);
             fprintf(outfd, catgets(elm_msg_cat,FilterSet,
                                    FilterCantOpenMailBox,
                    "filter (%s): Can't open mailbox %s!\n"),
!                   date_n_user(), lockfile);
           }
           if ((mailfd = emergency_local_delivery()) == NULL)
             exit(1);
--- 224,235 ----
           if (outfd != NULL) {
             fprintf(outfd, catgets(elm_msg_cat,FilterSet,
                                    FilterCouldntCreateLockFile,
!                    "filter (%s): Couldn't create lock file\n"),
!                   date_n_user());
             fprintf(outfd, catgets(elm_msg_cat,FilterSet,
                                    FilterCantOpenMailBox,
                    "filter (%s): Can't open mailbox %s!\n"),
!                   date_n_user(), mailbox);
           }
           if ((mailfd = emergency_local_delivery()) == NULL)
             exit(1);

Index: filter/filter.c
Prereq: 5.5
*** ../elm2.4/filter/filter.c   Sun Jun  6 14:24:47 1993
--- filter/filter.c     Tue Aug  3 15:28:40 1993
***************
*** 1,8 ****

! static char rcsid[] ="@(#)$Id: filter.c,v 5.5 1993/06/06 17:58:20 syd Exp $";

 /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  *
  *                    Copyright (c) 1988-1992 USENET Community Trust
  *                    Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----

! static char rcsid[] ="@(#)$Id: filter.c,v 5.6 1993/08/03 19:28:39 syd Exp $";

 /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  *
  *                    Copyright (c) 1988-1992 USENET Community Trust
  *                    Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
  *
  *******************************************************************************
  * $Log: filter.c,v $
+  * Revision 5.6  1993/08/03  19:28:39  syd
+  * Elm tries to replace the system toupper() and tolower() on current
+  * BSD systems, which is unnecessary.  Even worse, the replacements
+  * collide during linking with routines in isctype.o.  This patch adds
+  * a Configure test to determine whether replacements are really needed
+  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
+  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+  * there.  Inclusion of <ctype.h> was removed from *all* the individual
+  * files, and the toupper() and tolower() routines in lib/opt_utils.c
+  * were dropped.
+  * From: [email protected] (Chip Rosenthal)
+  *
  * Revision 5.5  1993/06/06  17:58:20  syd
  * make white space skipping work for blank or tab
  *
***************
*** 64,70 ****

 #include <stdio.h>
 #include <pwd.h>
- #include <ctype.h>
 #include "defs.h"
 #ifdef I_TIME
 #  include <time.h>
--- 76,81 ----

Index: filter/parse.c
Prereq: 5.11
*** ../elm2.4/filter/parse.c    Sun Apr 11 23:04:02 1993
--- filter/parse.c      Sun Sep 19 19:11:18 1993
***************
*** 1,8 ****

! static char rcsid[] ="@(#)$Id: parse.c,v 5.11 1993/04/12 03:04:01 syd Exp $";

 /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  *
  *                    Copyright (c) 1988-1992 USENET Community Trust
  *                    Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----

! static char rcsid[] ="@(#)$Id: parse.c,v 5.13 1993/09/19 23:11:17 syd Exp $";

 /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.13 $   $State: Exp $
  *
  *                    Copyright (c) 1988-1992 USENET Community Trust
  *                    Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,35 ----
  *
  *******************************************************************************
  * $Log: parse.c,v $
+  * Revision 5.13  1993/09/19  23:11:17  syd
+  * strtokq was called with the wrong number of parameters.
+  * From: [email protected] (Jan Djarv)
+  *
+  * Revision 5.12  1993/08/03  19:28:39  syd
+  * Elm tries to replace the system toupper() and tolower() on current
+  * BSD systems, which is unnecessary.  Even worse, the replacements
+  * collide during linking with routines in isctype.o.  This patch adds
+  * a Configure test to determine whether replacements are really needed
+  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
+  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+  * there.  Inclusion of <ctype.h> was removed from *all* the individual
+  * files, and the toupper() and tolower() routines in lib/opt_utils.c
+  * were dropped.
+  * From: [email protected] (Chip Rosenthal)
+  *
  * Revision 5.11  1993/04/12  03:04:01  syd
  * Removed a malloc of a struct condition_rec that is never used.
  * From: Jan Djarv <[email protected]>
***************
*** 77,83 ****
 **/

 #include <stdio.h>
- #include <ctype.h>

 #include "defs.h"
 #include "filter.h"
--- 93,98 ----
***************
*** 350,356 ****
               /* Special for regular expressions (enclosed between //) */
               cond_argument[0] = '\0';
               for (;;) {
!                 if ((word = strtokq(str, "/")) == NULL)
                   break;
                 strcat(cond_argument, word);
                 if (word[strlen(word)-1] == '\\') /* If / was escaped ... */
--- 365,371 ----
               /* Special for regular expressions (enclosed between //) */
               cond_argument[0] = '\0';
               for (;;) {
!                 if ((word = strtokq(str, "/", 0)) == NULL)
                   break;
                 strcat(cond_argument, word);
                 if (word[strlen(word)-1] == '\\') /* If / was escaped ... */