From: syd@dsinc.DSI.COM (Syd Weinstein)
Subject: elm 2.4 Patch #1
Followup-To: poster
Summary: This is an official patch for elm 2.4 system.  Please apply it.
Priority: HIGH
Organization: Datacomp Systems, Inc., Huntingdon Valley, PA 19006
Date: Tue, 13 Oct 1992 14:21:23 GMT

Part 1 of a 2 part Patch - 'Easy' Mods following release problems.

Switch to wrapper for flock and fcntl locking.
Change order to fcntl first, other order blocked.
From: Jukka Ukkonen <ukkonen@csc.fi>

Fix some compiler warnings that I receive compiling Elm on my SVR4
machine.
From: Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>

Add AIX to src/curses.c for define of window size in different include
file.
From: Syd via note from Tom Kovar

get_return() assumes that message_count reflects the number of
messages in the current folder, but the message_count it's seeing
from the alias subsystem is actually the *alias* count.
toggle the main state before and after calling get_return().
From: cliff@sfn.ORG (R. Cliff Young)

Add missing setlocale and getopen to newalias and listalias.
From: Syd

Touchups on config guide
From: David Barr <barr@pop.psu.edu>

Fix segv in wildcards if SHELL= has no / character in path
From: Syd

1. If firstname && lastname is null then copy aliasname into the 
personal name field (inside the ()'s) when creating an alias
from the menu using the 'n' command.

2. Now if for some reason and alias has a null personal name field
(the person hand edited aliases.text) the blank () is not printed
as part of the address.  This actually cured another problem, where
the To: field on the screen (when you hit 'm' on the alias menu)
used to be blank, now the address shows up....
From: "Robert L. Howard" <robert.howard@matd.gatech.edu>

Updated AIX 3.2 section of README file
From: Syd

fixed a bug in the .lp macro in doc/tmac.n.  The lp macros is always
called with a unit specified for the second argument, however, the
macro added a "n" unit specifier to that argument.  The following patch
fixes this problem.

The various .guide books use the troff .tl macro liberally, but often the
extra ' characters needed at the end of the lines to explicitly specify
the trailing nulls fields were left off.  The following patch fixes the
erroneous lines.
From: Larry Philps <larryp@sco.COM>

While installing elm2.4 on a Sun4 running SunOS4.1.2, the Configure script
doesn't recognize F_SETLK because it searches in /usr/include/sys/fcntl.h
which includes /usr/include/sys/fcntlcom.h (where F_SETLK is).
From: dax@ulysse.enst.fr (Philippe Dax)

change dbm name to dbz to avoid conflicts with partial call
ins from shared librarys, and from mixing code with yp code.
From: Syd via prompt from Jess Anderson

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:
		Do Nothing, Apply patch 2 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
	elm@DSI.COM

	The patches are available from the dsinc archive server
	Send the following message to archive-server@DSI.COM for
	a list of available patches:

	Subject: patch list
	send index elm

Index: hdrs/patchlevel.h
Prereq: 0
*** ../elm2.4/hdrs/patchlevel.h	Sat Oct  3 18:31:30 1992
--- hdrs/patchlevel.h	Sat Oct 10 22:07:22 1992
***************
*** 1 ****
! #define PATCHLEVEL 0
--- 1 ----
! #define PATCHLEVEL 1

Index: Configure
Prereq: 5.1
*** ../elm2.4/Configure	Sat Oct  3 18:12:32 1992
--- Configure	Sat Oct 10 22:06:25 1992
***************
*** 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.dev/RCS/Configure,v 5.1 1992/10/03 22:12:17 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.2 1992/10/11 02:06:07 syd Exp $
  #
  # Yes, you may rip this off to use in other distribution packages.
  # (Note: this Configure script was generated automatically.  Rather than
***************
*** 298,304 ****
  attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
  attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
  attrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386"
! attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__"
  pth="/usr/ucb /bin /usr/bin /sbin /usr/sbin /usr/local /usr/local/bin /usr/lbin"
  pth="$pth /usr/5bin /vol/local/bin /etc /usr/bsd /usr/lib /usr/css/lib /lib"
  pth="$pth /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb"
--- 298,304 ----
  attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
  attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
  attrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386"
! attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__ NeXT _AIX"
  pth="/usr/ucb /bin /usr/bin /sbin /usr/sbin /usr/local /usr/local/bin /usr/lbin"
  pth="$pth /usr/5bin /vol/local/bin /etc /usr/bsd /usr/lib /usr/css/lib /lib"
  pth="$pth /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb"
***************
*** 1960,1965 ****
--- 1960,1968 ----
  fi
  
  if $contains F_SETLK /usr/include/sys/fcntl.h >/dev/null 2>&1; then
+     echo 'F_SETLK found, fcntl locking available'
+     has_fcntl="$define"
+ elif $contains F_SETLK /usr/include/sys/fcntlcom.h >/dev/null 2>&1; then
      echo 'F_SETLK found, fcntl locking available'
      has_fcntl="$define"
  else

Index: README
*** ../elm2.4/README	Sat Oct  3 18:12:35 1992
--- README	Sat Oct 10 21:51:27 1992
***************
*** 48,53 ****
--- 48,59 ----
  this is because the mail delivery agent should be
  /usr/lib/mail/execmail instead of /usr/bin/rmail or /bin/rmail.
  
+ 	On Next's NeXTStep 3.0, use the compile flags 
+ -bsd -fwritable-strings, specify the include file directory
+ as /usr/include/bsd, and change, at the 'edit the config.sh'
+ file prompt, the value of d_memcpy to undef and sigtype to int.
+ (From: Jess Anderson)
+ 
  	From: Manuel Alberto Ricart <alberto@parsec.mixcom.com>, 
  for Next's version 1.0 it is necessary to answer -bsd for the
  Any additional cc flags? question and -lsys_s for the
***************
*** 65,72 ****
  This will make the binaries as small as possible. Otherwise
  if the smallest binary will be 16K or more.
  
! 	On IBM RISC 6000 AIX, you might get string funtion errors on the
! compile.  The solution is to do the following:
  > Look at /usr/lpp/bos/bsdsport. It tells you
  > to add following lines to /etc/xlc.cfg
  >  
--- 71,82 ----
  This will make the binaries as small as possible. Otherwise
  if the smallest binary will be 16K or more.
  
! 	On IBM RISC 6000 AIX, 3.2 or newer, to compile Elm
! during Configure, specify -U_STR__ to the 'Additional CFLAGS'
! question.  No other changes are needed.
! 
! 	On IBM RISC 6000 AIX, prior to 3.2, you might get string
! funtion errors on the compile.  The solution is to do the following:
  > Look at /usr/lpp/bos/bsdsport. It tells you
  > to add following lines to /etc/xlc.cfg
  >  
***************
*** 88,94 ****
  >   FINLAND             | tel 358-71-162805                |  
  >         
  
! 	Also on IBM RS/6000 AIX
  > If you want elm to make use of the NLS options documented for
  > sendmail (using sendmail.nl) you have to use the UNDOCUMENTED -x flag
  > on sendmail. See article in comp.unix.aix
--- 98,104 ----
  >   FINLAND             | tel 358-71-162805                |  
  >         
  
! 	Also on IBM RS/6000 AIX (Possibly only prior to 3.2)
  > If you want elm to make use of the NLS options documented for
  > sendmail (using sendmail.nl) you have to use the UNDOCUMENTED -x flag
  > on sendmail. See article in comp.unix.aix

Index: doc/Config.guid
Prereq: 5.1
*** ../elm2.4/doc/Config.guid	Sat Oct  3 16:54:22 1992
--- doc/Config.guid	Sat Oct 10 21:15:54 1992
***************
*** 1,4 ****
! .\" @(#)$Id: Config.guid,v 5.1 1992/10/03 20:51:50 syd Exp $
  .\"
  .\"  A guide to the ELM alias system and so on.
  .\"  format with:
--- 1,4 ----
! .\" @(#)$Id: Config.guid,v 5.2 1992/10/11 01:15:53 syd Exp $
  .\"
  .\"  A guide to the ELM alias system and so on.
  .\"  format with:
***************
*** 11,16 ****
--- 11,21 ----
  .\"	Syd Weinstein		elm@DSI.COM (dsinc!elm)
  .\"
  .\"  $Log: Config.guid,v $
+ .\" Revision 5.2  1992/10/11  01:15:53  syd
+ .\" A cleaned up Config.guid follows.  Corrected some spelling errors,
+ .\" and played with some formatting:
+ .\" From: David Barr <barr@pop.psu.edu>
+ .\"
  .\" Revision 5.1  1992/10/03  20:51:50  syd
  .\" Initial checkin as of 2.4 Release at PL0
  .\"
***************
*** 125,168 ****
  some of the options available.  Not all the questions or options to
  those questions are explained.
  .sp 2
! .pg
! Use fcntl style locking?
  .br
! Use flock style locking?
  .br
! Use dotlock (.lock) style locking?
  .sp
! Elm, like all Mail User Agents, has times when it needs exclusive
  access to the mail spool file.  There are three methods of locking the
! mail spool file: .lock, fcntl and flock.  .lock is the original method,
  and is used by mail MUA and Mail Transport Agents (MTAs).  Whenever
  possible .lock should be enabled to assure backwards compatibility with
  older MUAs and MTAs.
  .sp
! BSD systems introduced flock style locking.  It uses a system call
  to lock the file on the local node.  System V later introduced
! fcntl style locking, which can also use a protocol for remote locking
  across the network.  Where both styles are available, it is advisable
  to use both, unless you are sure that only one is in use at your site.
  .sp
  Under many System V Release 4 systems, they both use the same underlying
! system call.  (Flock is translated into fcntl style locking) so for that
! version of UNIX, flock is not needed and fcntl style alone can be used.
  .pg
! Enable calendar feature?
  .sp
! Elm has a feature to take specially marked lines within mail messages
  and add them to a file for use by the system calendar program.  The
  command to do this extraction needs to be enabled to work.  There is
  also a follow on question regarding the name of the calendar file:
  .pg
! Default calendar file?
  .sp
  which is usually calendar on most systems.  This file will reside in
! the users home directory, not their .elm directory.
  .pg
! Does your /etc/passwd file keep full names in Berkeley/V7 format (name
! first thing after ':' in GCOS field)?
  .sp
  Elm uses the full name from the password file if it is available.
  There are two major ways this name is stored.  Berkeley/V7 systems
--- 130,172 ----
  some of the options available.  Not all the questions or options to
  those questions are explained.
  .sp 2
! \f3Use fcntl style locking?\f1
  .br
! \f3Use flock style locking?\f1
  .br
! \f3Use dotlock (.lock) style locking?\f1
  .sp
! \f3Elm\f1, like all Mail User Agents, has times when it needs exclusive
  access to the mail spool file.  There are three methods of locking the
! mail spool file: .lock, fcntl() and flock().  .lock is the original method,
  and is used by mail MUA and Mail Transport Agents (MTAs).  Whenever
  possible .lock should be enabled to assure backwards compatibility with
  older MUAs and MTAs.
  .sp
! BSD systems introduced flock() style locking.  It uses a system call
  to lock the file on the local node.  System V later introduced
! fcntl() style locking, which can also use a protocol for remote locking
  across the network.  Where both styles are available, it is advisable
  to use both, unless you are sure that only one is in use at your site.
  .sp
  Under many System V Release 4 systems, they both use the same underlying
! system call.  (Flock() is translated into fcntl() style locking) so for that
! version of UNIX, flock() is not needed and fcntl() style alone can be used.
  .pg
! \f3Enable calendar feature?\f1
  .sp
! \f3Elm\f1 has a feature to take specially marked lines within mail messages
  and add them to a file for use by the system calendar program.  The
  command to do this extraction needs to be enabled to work.  There is
  also a follow on question regarding the name of the calendar file:
  .pg
! \f3Default calendar file?\f1
  .sp
  which is usually calendar on most systems.  This file will reside in
! the user's home directory, not their .elm directory.
  .pg
! \f3Does your /etc/passwd file keep full names in Berkeley/V7 format (name
! first thing after ':' in GCOS field)?\f1
  .sp
  Elm uses the full name from the password file if it is available.
  There are two major ways this name is stored.  Berkeley/V7 systems
***************
*** 169,185 ****
  place the name as the entire GCOS field string, that is it starts
  directly after the ':' that delimits the fields.  USG
  .ux " Systems" (
! Group, or AT&T) systems put the users name after a department number
! and separate it from that number by a '-'.  The end of the users full
  name in these systems is a '('.  Look at your /etc/password file and if
  either version applies, answer yes to that version.  If neither
! applies, answer no.  Elm can still get the users name from the
  ".fullname" file in their home directory.
  .pg
! Every now and then someone has a (gethostname, uname) that lies about
  the hostname but can't be fixed for political or economic reasons.
! Would you like to pretend (gethostname, uname) isn't there and maybe
! compile in the hostname?
  .sp
  Elm needs to know the correct name of the host on which it is executing
  to be able to create the proper headers for the outbound mail.  Some
--- 173,189 ----
  place the name as the entire GCOS field string, that is it starts
  directly after the ':' that delimits the fields.  USG
  .ux " Systems" (
! Group, or AT&T) systems put the user's name after a department number
! and separate it from that number by a '-'.  The end of the user's full
  name in these systems is a '('.  Look at your /etc/password file and if
  either version applies, answer yes to that version.  If neither
! applies, answer no.  \f3Elm\f1 can still get the user's name from the
  ".fullname" file in their home directory.
  .pg
! \f3Every now and then someone has a (gethostname(), uname()) that lies about
  the hostname but can't be fixed for political or economic reasons.
! Would you like to pretend (gethostname(), uname()) isn't there and maybe
! compile in the hostname?\f1
  .sp
  Elm needs to know the correct name of the host on which it is executing
  to be able to create the proper headers for the outbound mail.  Some
***************
*** 189,195 ****
  cases this should not be needed.  It is provided just in case there is
  a problem with your system.
  .pg
! Honors Content-Length: header?
  .sp
  Starting with System V Release 4, many of the Mail Transport Agents are
  binary transparent.  This allows for sending binary messages, such as
--- 193,199 ----
  cases this should not be needed.  It is provided just in case there is
  a problem with your system.
  .pg
! \f3Honors Content-Length: header?\f1
  .sp
  Starting with System V Release 4, many of the Mail Transport Agents are
  binary transparent.  This allows for sending binary messages, such as
***************
*** 211,217 ****
  a lone period into a period and then a blank to avoid this problem.
  This symbol is ignored if the honors Content-Length: is answered YES.
  .pg
! Does your mailer understand INTERNET addresses?
  .sp
  Elm will work with systems that can process the `@' character of
  INTERNET format addresses or with the `!' format of uucp addresses.  If
--- 215,221 ----
  a lone period into a period and then a blank to avoid this problem.
  This symbol is ignored if the honors Content-Length: is answered YES.
  .pg
! \f3Does your mailer understand INTERNET addresses?\f1
  .sp
  Elm will work with systems that can process the `@' character of
  INTERNET format addresses or with the `!' format of uucp addresses.  If
***************
*** 220,226 ****
  mail with the `@' format addresses (such as elm@dsi.com), they bounce,
  then answer this question no.
  .pg
! Am I going to be running as a setgid program?
  .sp
  On USG type systems and many other types, access to the mailboxes and
  the mailbox directory is via the group permissions.  The mail user
--- 224,230 ----
  mail with the `@' format addresses (such as elm@dsi.com), they bounce,
  then answer this question no.
  .pg
! \f3Am I going to be running as a setgid program?\f1
  .sp
  On USG type systems and many other types, access to the mailboxes and
  the mailbox directory is via the group permissions.  The mail user
***************
*** 229,244 ****
  files.  If the permissions on your mailbox directory are drwxrwxr-x,
  then Elm needs to be a setgid program.
  .pg
! What is the default editor on your system?
  .sp
! If no editor is specified in the users \f2.elm/elmrc file,\f1 this is
  which editor to use.  The editor is used to compose outbound mail
  messages.
  .pg
! What pager do you prefer to use with Elm?
  .sp
  This is the standard pager to use for reading messages.  Besides the
! usual system pagers, two Elm specific internal options exist: builtin
  and builtin+.  The built-in pager is faster to execute but much less
  flexible than the system provided pagers.  The + version just clears
  the page before displaying the next page.  Otherwise the two versions
--- 233,248 ----
  files.  If the permissions on your mailbox directory are drwxrwxr-x,
  then Elm needs to be a setgid program.
  .pg
! \f3What is the default editor on your system?\f1
  .sp
! If no editor is specified in the user's \f2.elm/elmrc file,\f1 this is
  which editor to use.  The editor is used to compose outbound mail
  messages.
  .pg
! \f3What pager do you prefer to use with Elm?\f1
  .sp
  This is the standard pager to use for reading messages.  Besides the
! usual system pagers, two \f3Elm\f1 specific internal options exist: builtin
  and builtin+.  The built-in pager is faster to execute but much less
  flexible than the system provided pagers.  The + version just clears
  the page before displaying the next page.  Otherwise the two versions
***************
*** 276,288 ****
  alias area and contains the actual addresses for each of the aliases
  contained in the hashed data file.
  .lp ALIAS_TEXT 1.0i
! This is where the individual users alias text file lives.
  .lp ALIAS_HASH 1.0i
  Where the hashed aliases are stored,
  .lp ALIAS_DATA 1.0i
  and where the alias address data itself is kept.
  .lp DEBUGFILE 1.0i
! The name of the file to put in the users home directory if they choose to
  use the `-d' debug option. 
  .lp OLDEBUG 1.0i
  The name of the file to save the previous debug output as.  (this feature
--- 280,292 ----
  alias area and contains the actual addresses for each of the aliases
  contained in the hashed data file.
  .lp ALIAS_TEXT 1.0i
! This is where the individual user's alias text file lives.
  .lp ALIAS_HASH 1.0i
  Where the hashed aliases are stored,
  .lp ALIAS_DATA 1.0i
  and where the alias address data itself is kept.
  .lp DEBUGFILE 1.0i
! The name of the file to put in the user's home directory if they choose to
  use the `-d' debug option. 
  .lp OLDEBUG 1.0i
  The name of the file to save the previous debug output as.  (this feature
***************
*** 320,326 ****
  The help file name prefix.
  .lp ELMRC_INFO 1.0i
  The file containing textual messages associated with each
! \f3Elm\f1 variable setting in the users \f2``.elm/elmrc''\f1
  file.  This is used when the user chooses to auto-save the
  options from within the main program.
  .lp elmrcfile 1.0i
--- 324,330 ----
  The help file name prefix.
  .lp ELMRC_INFO 1.0i
  The file containing textual messages associated with each
! \f3Elm\f1 variable setting in the user's \f2``.elm/elmrc''\f1
  file.  This is used when the user chooses to auto-save the
  options from within the main program.
  .lp elmrcfile 1.0i
***************
*** 329,334 ****
--- 333,342 ----
  .lp old_elmrcfile 1.0i
  When a new elmrc file is saved, the old one is also saved, being
  renamed to whatever this identifier is set to.
+ .lp system_rc_file 1.0i
+ The name of the global elmrc file (default is \f2$lib/elm.rc\f1).  This
+ is where the system administrator puts global default values for any
+ parameters located in the \f2.elm/elmrc\f1 file.
  .lp mailheaders  1.0i
  The name of the optional file that users may have that will be
  included in the headers of each outbound message.
***************
*** 339,346 ****
  In the strange case when the mailer suddenly finds all the directories
  it uses shut off (like \f2/usr/mail\f1 and \f2/tmp\f1) 
  then it'll put the current
! mailbox into this file in the users home directory.
  .lp newalias 1.0i
  How to install new aliases..(note: you MUST have the '-q' flag!)
  .lp readmsg 1.0i
  What the \f2readmsg(1L)\f1 program is installed as.
--- 347,364 ----
  In the strange case when the mailer suddenly finds all the directories
  it uses shut off (like \f2/usr/mail\f1 and \f2/tmp\f1) 
  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: you MUST have the '-q' flag!)
  .lp readmsg 1.0i
  What the \f2readmsg(1L)\f1 program is installed as.
+ .hu Runtime configuration - the global \f2$lib/elm.rc\f1 file
+ .pg
+ No global default file is provided as part of the installation of \f3Elm\f1.
+ If you wish to override any default parameters for all users, create
+ a file as defined in the "system_rc_file" above.  An easy way to create
+ it is to copy a saved \f2.elm/elmrc\f1 and edit it to remove all
+ user-specific parameters.  Of particular interest are three additional
+ parameters you may set: "hostdomain," "hostfullname," and "hostname."
+ See the "String Variables" section in the second chapter of the \f2Elm
+ Reference Guide\f1 for details on these variables.

Index: doc/Form.guide
Prereq: 5.1
*** ../elm2.4/doc/Form.guide	Sat Oct  3 16:54:23 1992
--- doc/Form.guide	Sat Oct 10 21:33:37 1992
***************
*** 1,4 ****
! .\" @(#)$Id: Form.guide,v 5.1 1992/10/03 20:51:50 syd Exp $
  .\"
  .\"  A guide to using the Elm Forms mode
  .\"  format with:
--- 1,4 ----
! .\" @(#)$Id: Form.guide,v 5.2 1992/10/11 01:33:36 syd Exp $
  .\"
  .\"  A guide to using the Elm Forms mode
  .\"  format with:
***************
*** 12,17 ****
--- 12,29 ----
  .\"  Copyright (c) 1986,1987 Dave Taylor
  .\"
  .\"  $Log: Form.guide,v $
+ .\" Revision 5.2  1992/10/11  01:33:36  syd
+ .\" fixed a bug in the .lp macro in doc/tmac.n.  The lp macros is always
+ .\" called with a unit specified for the second argument, however, the
+ .\" macro added a "n" unit specifier to that argument.  The following patch
+ .\" fixes this problem.
+ .\"
+ .\" The various .guide books use the troff .tl macro liberally, but often the
+ .\" extra ' characters needed at the end of the lines to explicitly specify
+ .\" the trailing nulls fields were left off.  The following patch fixes the
+ .\" erroneous lines.
+ .\" From: Larry Philps <larryp@sco.COM>
+ .\"
  .\" Revision 5.1  1992/10/03  20:51:50  syd
  .\" Initial checkin as of 2.4 Release at PL0
  .\"
***************
*** 145,158 ****
  .tl 'Program:\ \l'2.3i-\w'Program:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
  .tl 'Operating\ System:\ \l'2.3i-\w'Operating\ System:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
  .sp
! .tl 'Defect\ Type:\ \l'2.3i-\w'Defect\ Type:\ 'u'''
  .sp
  .tl 'Date\ Found:\ \l'2.3i-\w'Date\ Found:\ 'u'''By\ Whom:\ \l'2.3i-\w'By\ Whom:\ 'u'\h'.2i''
  .tl 'Date\ Reported:\ \l'2.3i-\w'Date\ Reported:\ 'u'''Phone:\ \l'2.3i-\w'Phone:\ 'u'\h'.2i''
  .sp
! .tl 'Description:\ \l'6.4i-\w'Description:\ 'u''
! .tl '\l'6.4i''
! .tl '\l'6.4i''
  .sp
  .eb
  .ed
--- 157,170 ----
  .tl 'Program:\ \l'2.3i-\w'Program:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
  .tl 'Operating\ System:\ \l'2.3i-\w'Operating\ System:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
  .sp
! .tl 'Defect\ Type:\ \l'2.3i-\w'Defect\ Type:\ 'u''''
  .sp
  .tl 'Date\ Found:\ \l'2.3i-\w'Date\ Found:\ 'u'''By\ Whom:\ \l'2.3i-\w'By\ Whom:\ 'u'\h'.2i''
  .tl 'Date\ Reported:\ \l'2.3i-\w'Date\ Reported:\ 'u'''Phone:\ \l'2.3i-\w'Phone:\ 'u'\h'.2i''
  .sp
! .tl 'Description:\ \l'6.4i-\w'Description:\ 'u''''
! .tl '\l'6.4i''''
! .tl '\l'6.4i''''
  .sp
  .eb
  .ed
***************
*** 178,191 ****
  .tl 'Program:''Version:\h'1.7i-\w'Version:'u''
  .tl 'Operating System:''Version:\h'1.7i-\w'Version:'u''
  .sp
! .tl '(Valid Defect Types are: user-error, doc-error, fatal, other)'
! .tl 'Defect Type:''
  .sp
  .tl 'Date Found:''By\ Whom:\h'2.3i-\w'By\ Whom:'u''
  .tl 'Date Reported:''Phone:\h'2.3i-\w'Phone:'u''
  .sp
! .tl 'Description'
! .tl ':'
  .sp
  Thank you for filling in this form.
  .sp 2
--- 190,203 ----
  .tl 'Program:''Version:\h'1.7i-\w'Version:'u''
  .tl 'Operating System:''Version:\h'1.7i-\w'Version:'u''
  .sp
! .tl '(Valid Defect Types are: user-error, doc-error, fatal, other)'''
! .tl 'Defect Type:'''
  .sp
  .tl 'Date Found:''By\ Whom:\h'2.3i-\w'By\ Whom:'u''
  .tl 'Date Reported:''Phone:\h'2.3i-\w'Phone:'u''
  .sp
! .tl 'Description'''
! .tl ':'''
  .sp
  Thank you for filling in this form.
  .sp 2
***************
*** 360,376 ****
  .tl ' Program: The Elm Mail System''Version: 1.5\h'1.5i-\w'Version: 1.5'u''
  .tl ' Operating System: HP-UX''Version: 5.141 C\h'1.5i-\w'Version: 5.141 C'u''
  .sp
! .tl ' (Valid Defect Types are: user-error, doc-error, fatal, other)'
! .tl ' Defect Type: fatal''
  .sp
  .tl ' Date Found: 10/9/86''By Whom: Dave Taylor\h'2.3i-\w'By Whom: Dave Taylor'u''
  .tl ' Date Reported: 10/9/86''Phone: (415) 857-6887\h'2.3i-\w'Phone: (415) 857-6887'u''
  .sp
! .tl ' Description'
  .sp
      When running it on a CPM system I cannot compile successfully.
  .sp 
! .tl ' Thank you for filling in this form.'
   ***
  .sp
  .eb
--- 372,388 ----
  .tl ' Program: The Elm Mail System''Version: 1.5\h'1.5i-\w'Version: 1.5'u''
  .tl ' Operating System: HP-UX''Version: 5.141 C\h'1.5i-\w'Version: 5.141 C'u''
  .sp
! .tl ' (Valid Defect Types are: user-error, doc-error, fatal, other)'''
! .tl ' Defect Type: fatal'''
  .sp
  .tl ' Date Found: 10/9/86''By Whom: Dave Taylor\h'2.3i-\w'By Whom: Dave Taylor'u''
  .tl ' Date Reported: 10/9/86''Phone: (415) 857-6887\h'2.3i-\w'Phone: (415) 857-6887'u''
  .sp
! .tl ' Description'''
  .sp
      When running it on a CPM system I cannot compile successfully.
  .sp 
! .tl ' Thank you for filling in this form.'''
   ***
  .sp
  .eb

Index: doc/Ref.guide
Prereq: 5.2
*** ../elm2.4/doc/Ref.guide	Sat Oct  3 21:16:08 1992
--- doc/Ref.guide	Sat Oct 10 21:33:38 1992
***************
*** 1,4 ****
! .\" @(#)$Id: Ref.guide,v 5.2 1992/10/04 01:15:43 syd Exp $
  .\"
  .\"  Reference guide to the Elm mail system.
  .\"  format with 
--- 1,4 ----
! .\" @(#)$Id: Ref.guide,v 5.3 1992/10/11 01:33:36 syd Exp $
  .\"
  .\"  Reference guide to the Elm mail system.
  .\"  format with 
***************
*** 12,17 ****
--- 12,29 ----
  .\"  (C) Copyright 1988-1992 Usenet Community Trust
  .\"
  .\"  $Log: Ref.guide,v $
+ .\" Revision 5.3  1992/10/11  01:33:36  syd
+ .\" fixed a bug in the .lp macro in doc/tmac.n.  The lp macros is always
+ .\" called with a unit specified for the second argument, however, the
+ .\" macro added a "n" unit specifier to that argument.  The following patch
+ .\" fixes this problem.
+ .\"
+ .\" The various .guide books use the troff .tl macro liberally, but often the
+ .\" extra ' characters needed at the end of the lines to explicitly specify
+ .\" the trailing nulls fields were left off.  The following patch fixes the
+ .\" erroneous lines.
+ .\" From: Larry Philps <larryp@sco.COM>
+ .\"
  .\" Revision 5.2  1992/10/04  01:15:43  syd
  .\" Emphasize that hostdomain, hostname and hostfullname must all be specified
  .\" if one is specified in elmrc file.
***************
*** 1496,1502 ****
  .ft CW
  .zf
  .ps 9
! .tl ''     Folder is "=elm" with 92 shown out of 124 [Elm 2.4]'
  .ps 10
  .ft 1
  .fi
--- 1508,1514 ----
  .ft CW
  .zf
  .ps 9
! .tl ''     Folder is "=elm" with 92 shown out of 124 [Elm 2.4]''
  .ps 10
  .ft 1
  .fi

Index: doc/Users.guide
Prereq: 5.1
*** ../elm2.4/doc/Users.guide	Sat Oct  3 16:54:25 1992
--- doc/Users.guide	Sat Oct 10 21:33:39 1992
***************
*** 1,4 ****
! .\" @(#)$Id: Users.guide,v 5.1 1992/10/03 20:51:50 syd Exp $
  .\"
  .\"  Users guide to the ELM mail system.
  .\"  format with:
--- 1,4 ----
! .\" @(#)$Id: Users.guide,v 5.2 1992/10/11 01:33:36 syd Exp $
  .\"
  .\"  Users guide to the ELM mail system.
  .\"  format with:
***************
*** 12,17 ****
--- 12,29 ----
  .\"  (C) Copyright 1988-1992 Usenet Community Trust
  .\"
  .\"  $Log: Users.guide,v $
+ .\" Revision 5.2  1992/10/11  01:33:36  syd
+ .\" fixed a bug in the .lp macro in doc/tmac.n.  The lp macros is always
+ .\" called with a unit specified for the second argument, however, the
+ .\" macro added a "n" unit specifier to that argument.  The following patch
+ .\" fixes this problem.
+ .\"
+ .\" The various .guide books use the troff .tl macro liberally, but often the
+ .\" extra ' characters needed at the end of the lines to explicitly specify
+ .\" the trailing nulls fields were left off.  The following patch fixes the
+ .\" erroneous lines.
+ .\" From: Larry Philps <larryp@sco.COM>
+ .\"
  .\" Revision 5.1  1992/10/03  20:51:50  syd
  .\" Initial checkin as of 2.4 Release at PL0
  .\"
***************
*** 555,561 ****
  .zf
  .ps 9
  .sp 
! .tl '-------------------------------------------------------------------------------''
  .tl 'Command: Reply to message''Copy message (y/n) ? @ '
  .sp 2
  .ft 1
--- 567,573 ----
  .zf
  .ps 9
  .sp 
! .tl '-------------------------------------------------------------------------------'''
  .tl 'Command: Reply to message''Copy message (y/n) ? @ '
  .sp 2
  .ft 1
***************
*** 567,575 ****
  .zf
  .ps 9
  .sp
! .tl '-------------------------------------------------------------------------------''
  .tl 'Command: Reply to message''To: Larry Fenske '
! .tl 'Subject: Re: Hello there@''
  .ft 1
  .ps 10
  .sp 2
--- 579,587 ----
  .zf
  .ps 9
  .sp
! .tl '-------------------------------------------------------------------------------'''
  .tl 'Command: Reply to message''To: Larry Fenske '
! .tl 'Subject: Re: Hello there@'''
  .ft 1
  .ps 10
  .sp 2
***************
*** 583,591 ****
  .ft CW
  .zf
  .sp
! .tl '-------------------------------------------------------------------------------''
  .tl 'Command: reply to message''To: Larry Fenske '
! .tl 'Subject: Re: Hello there''
  .tl 'Copies to: @'''
  .ps 10
  .ft 1
--- 595,603 ----
  .ft CW
  .zf
  .sp
! .tl '-------------------------------------------------------------------------------'''
  .tl 'Command: reply to message''To: Larry Fenske '
! .tl 'Subject: Re: Hello there'''
  .tl 'Copies to: @'''
  .ps 10
  .ft 1
***************
*** 714,720 ****
  .ft CW
  .zf
  .sp
! .tl '-------------------------------------------------------------------------------''
  .tl 'Command: Forward message''Edit outgoing message (y/n) ? @ '
  .ft 1
  .ps 10
--- 726,732 ----
  .ft CW
  .zf
  .sp
! .tl '-------------------------------------------------------------------------------'''
  .tl 'Command: Forward message''Edit outgoing message (y/n) ? @ '
  .ft 1
  .ps 10
***************
*** 724,730 ****
  .ps 9
  .ft CW
  .zf
! .tl '-------------------------------------------------------------------------------''
  .tl 'Command: Forward message''Edit outgoing message (y/n) ? No '
  .tl 'To: @'''
  .ps 10
--- 736,742 ----
  .ps 9
  .ft CW
  .zf
! .tl '-------------------------------------------------------------------------------'''
  .tl 'Command: Forward message''Edit outgoing message (y/n) ? No '
  .tl 'To: @'''
  .ps 10
***************
*** 740,748 ****
  .zf
  .ps 9
  .sp
! .tl '-------------------------------------------------------------------------------''
  .tl 'Command: Forward message''To: usenet '
! .tl 'Subject: More software requests (fwd)@'
  .ft 1
  .ps 10
  .sp
--- 752,760 ----
  .zf
  .ps 9
  .sp
! .tl '-------------------------------------------------------------------------------'''
  .tl 'Command: Forward message''To: usenet '
! .tl 'Subject: More software requests (fwd)@'''
  .ft 1
  .ps 10
  .sp

Index: doc/tmac.n
Prereq: 5.1
*** ../elm2.4/doc/tmac.n	Sat Oct  3 16:54:32 1992
--- doc/tmac.n	Sat Oct 10 21:33:36 1992
***************
*** 1,4 ****
! .\" @(#)$Id: tmac.n,v 5.1 1992/10/03 20:53:59 syd Exp $
  .\" The News macro package
  .\"
  .\" This  is  the macro package that is used to format news documents.  It
--- 1,4 ----
! .\" @(#)$Id: tmac.n,v 5.2 1992/10/11 01:33:36 syd Exp $
  .\" The News macro package
  .\"
  .\" This  is  the macro package that is used to format news documents.  It
***************
*** 354,360 ****
  ..
  .de lp					\" labelled paragraph
  .pg l					\" reset paragraph
! .if \\n(.$>1 .nr li \\$2n		\" if indent given use it
  .in +\\n(liu				\" indent for paragraph
  .ti -\\n(liu				\" force first line NOT to indent
  .ta +\\n(liu				\" for the label
--- 354,360 ----
  ..
  .de lp					\" labelled paragraph
  .pg l					\" reset paragraph
! .if \\n(.$>1 .nr li \\$2		\" if indent given use it
  .in +\\n(liu				\" indent for paragraph
  .ti -\\n(liu				\" force first line NOT to indent
  .ta +\\n(liu				\" for the label

Index: filter/lock.c
Prereq: 5.1
*** ../elm2.4/filter/lock.c	Sat Oct  3 18:18:28 1992
--- filter/lock.c	Sun Oct 11 20:25:53 1992
***************
*** 1,8 ****
  
! static char rcsid[] ="@(#)$Id: lock.c,v 5.1 1992/10/03 22:18:09 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] ="@(#)$Id: lock.c,v 5.3 1992/10/12 00:25:52 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log: lock.c,v $
+  * Revision 5.3  1992/10/12  00:25:52  syd
+  * Lock error codes (fcntl vs flock) were backwards
+  * From: howardl@wb3ffv.ampr.org (Howard Leadmon - WB3FFV)
+  *
+  * Revision 5.2  1992/10/11  00:52:11  syd
+  * Switch to wrapper for flock and fcntl locking.
+  * Change order to fcntl first, other order blocked.
+  * From: Jukka Ukkonen <ukkonen@csc.fi>
+  *
   * Revision 5.1  1992/10/03  22:18:09  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 56,64 ****
--- 65,162 ----
  static	char flock_name[SLEN];
  #endif
  
+ #define	FLOCKING_OK	0
+ #define	FLOCKING_RETRY	1
+ #define	FLOCKING_FAIL	-1
+ 
  extern  int  errno;
  
  int
+ Grab_the_file(flock_fd)
+ int flock_fd;
+ {
+     int	retcode	= FLOCKING_OK;
+ 
+     errno = 0;
+ 
+ #ifdef   USE_FCNTL_LOCKING
+     lock_info.l_type = F_WRLCK;
+     lock_info.l_whence = 0;
+     lock_info.l_start = 0;
+     lock_info.l_len = 0;
+ 
+     if (fcntl(flock_fd, F_SETLK, &lock_info)) {
+ 	return ((errno == EACCES) || (EAGAIN))
+ 		? FLOCKING_RETRY
+ 		: FLOCKING_FAIL ;
+     }
+ #endif
+ 
+ #ifdef	USE_FLOCK_LOCKING
+     if (flock (flock_fd, LOCK_NB | LOCK_EX)) {
+ 
+ 	retcode = ((errno == EWOULDBLOCK) || (errno == EAGAIN))
+ 		   ? FLOCKING_RETRY
+ 		   : FLOCKING_FAIL ;
+ 
+ #ifdef USE_FCNTL_LOCKING
+ 	lock_info.l_type = F_UNLCK;
+ 	lock_info.l_whence = 0;
+ 	lock_info.l_start = 0;
+ 	lock_info.l_len = 0;
+ 
+ 	/*
+ 	 *  Just unlock it because we did not succeed with the
+ 	 *  flock()-style locking. Never mind the return value.
+ 	 *  It was our own lock anyway if we ever got this far.
+ 	 */
+ 	fcntl (flock_fd, F_SETLK, &lock_info);
+ #endif
+ 	return retcode;
+     }
+ #endif
+ 
+     return FLOCKING_OK;
+ }
+ 
+ int
+ Release_the_file(flock_fd)
+ int flock_fd;
+ {
+     int	fcntlret = 0,
+ 	flockret = 0,
+ 	fcntlerr,
+ 	flockerr;
+ 
+ #ifdef	USE_FLOCK_LOCKING
+     errno = 0;
+     flockret = flock (flock_fd, LOCK_UN);
+     flockerr = errno;
+ #endif
+ 
+ #ifdef	USE_FCNTL_LOCKING
+     lock_info.l_type = F_UNLCK;
+     lock_info.l_whence = 0;
+     lock_info.l_start = 0;
+     lock_info.l_len = 0;
+ 
+     errno = 0;
+     fcntlret = fcntl (flock_fd, F_SETLK, &lock_info);
+     fcntlerr = errno;
+ #endif
+ 
+     if (fcntlret) {
+ 	errno = fcntlerr;
+ 	return fcntlret;
+     }
+     else if (flockret) {
+ 	errno = flockret;
+ 	return flockret;
+     }
+     return 0;
+ }
+ 
+ int
  lock()
  {
  	/** This routine will return 1 if we could lock the mailfile,
***************
*** 107,169 ****
  
  #ifdef	NEEDS_FLOCK_FD			/* { NEEDS_FLOCK_FD	*/
  	(void)sprintf(flock_name,"%s%s",mailhome,username);
! 	flock_fd = open(flock_name, O_RDONLY | O_CREAT, 0600);
! #ifdef USE_FCNTL_LOCKING
! 	if ( flock_fd >= 0 ) {
! 	  for (attempts = 0; attempts < 10; attempts++) {
! 	    lock_info.l_type = F_WRLCK;
! 	    lock_info.l_whence = 0;
! 	    lock_info.l_start = 0;
! 	    lock_info.l_len = 0;
! 	    if ( (ret = fcntl(flock_fd,F_SETLK,&lock_info)) != -1)
! 	        break;
! 	    if (errno != EAGAIN && errno != EACCES)
! 	        break;
! 	    (void)sleep((unsigned)3);
! 	  }
! 
! 	  if ( ret == 0 ) {
! 	      we_locked_it++;
! 	      ret = 1;
! 	  } else {
! 	      we_locked_it = 0;
! 	      if ( lockfile[0] ) {
! 		  (void)unlink(lockfile);
! 		  lockfile[0] = 0;
! 	      }
! 	    (void)close(flock_fd);
! 	    flock_fd = -1;
! 	    ret = 0;
! 	  }
! 	}
! #endif
  
- #ifdef USE_FLOCK_LOCKING
  	if ( flock_fd >= 0 ) {
! 	  for (attempts = 0; attempts < 10; attempts++) {
! 	    if ( (ret = flock(flock_fd,LOCK_NB|LOCK_EX)) != -1 )
! 	        break;
! 	    if ( errno != EWOULDBLOCK && errno != EAGAIN )
! 	        break;
  
! 	    (void)sleep((unsigned)3);
! 	  }
  
! 	  if ( ret == 0 ) {
! 	      we_locked_it++;
! 	      ret = 1;
! 	  } else {
! 	      we_locked_it = 0;
! 	      if ( lockfile[0] ) {
! 		  (void)unlink(lockfile);
! 		  lockfile[0] = 0;
! 	      }
! 	    (void)close(flock_fd);
! 	    flock_fd = -1;
! 	    ret = 0;
! 	  }
  	}
- #endif
  #endif					 /* { NEEDS_FLOCK_FD	*/
  	return(ret);
  }
--- 205,238 ----
  
  #ifdef	NEEDS_FLOCK_FD			/* { NEEDS_FLOCK_FD	*/
  	(void)sprintf(flock_name,"%s%s",mailhome,username);
! 	flock_fd = open(flock_name, O_RDWR | O_CREAT, 0600);
  
  	if ( flock_fd >= 0 ) {
! 	    for (attempts = 0; attempts < 10; attempts++) {
  
! 		ret = Grab_the_file (flock_fd);
! 	    
! 		if ((ret == FLOCKING_FAIL) || (ret == FLOCKING_OK)) {
! 		    break;
! 		}
! 		(void)sleep((unsigned)3);
! 	    }
  
! 	    if ( ret == FLOCKING_OK ) {
! 		we_locked_it++;
! 		ret = 1;
! 	    }
! 	    else {
! 		we_locked_it = 0;
! 		if ( lockfile[0] ) {
! 		    (void)unlink(lockfile);
! 		    lockfile[0] = 0;
! 		}
! 		(void)close(flock_fd);
! 		flock_fd = -1;
! 		ret = 0;
! 	    }
  	}
  #endif					 /* { NEEDS_FLOCK_FD	*/
  	return(ret);
  }
***************
*** 175,188 ****
  
  #ifdef	USE_DOTLOCK_LOCKING
  	if (we_locked_it && lockfile[0]) {
! 	  unlink(lockfile);	/* blamo! */
! 	  lockfile[0] = 0;
  	}
  #endif
  #ifdef	NEED_FLOCK_FD
  	if (we_locked_it && flock_fd >= 0) {
! 	  (void)close(flock_fd);
! 	  flock_fd = -1;
  	}
  #endif
  	we_locked_it = 0;
--- 244,264 ----
  
  #ifdef	USE_DOTLOCK_LOCKING
  	if (we_locked_it && lockfile[0]) {
! 	    unlink(lockfile);	/* blamo! */
! 	    lockfile[0] = 0;
  	}
  #endif
  #ifdef	NEED_FLOCK_FD
  	if (we_locked_it && flock_fd >= 0) {
! 	    /*
! 	     *	Give it at least a decent try. OK?
! 	     */
! 	    (void) Release_the_file (flock_fd);
! 	    /*
! 	     *	And then blast the locks anyway...
! 	     */
! 	    (void) close (flock_fd);
! 	    flock_fd = -1;
  	}
  #endif
  	we_locked_it = 0;

Index: hdrs/ndbz.h
Prereq: 5.1
*** ../elm2.4/hdrs/ndbz.h	Sat Oct  3 18:35:10 1992
--- hdrs/ndbz.h	Sat Oct 10 21:47:09 1992
***************
*** 1,8 ****
  
! /* $Id: ndbz.h,v 5.1 1992/10/03 22:34:39 syd Exp $ */
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! /* $Id: ndbz.h,v 5.2 1992/10/11 01:46:35 syd Exp $ */
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: ndbz.h,v $
+  * Revision 5.2  1992/10/11  01:46:35  syd
+  * change dbm name to dbz to avoid conflicts with partial call
+  * ins from shared librarys, and from mixing code with yp code.
+  * From: Syd via prompt from Jess Anderson
+  *
   * Revision 5.1  1992/10/03  22:34:39  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 40,46 ****
  #define	SHISTBUF	512
  #endif
  
! /* for dbm and ndbz */
  typedef struct {
  	char *dptr;
  	int dsize;
--- 45,51 ----
  #define	SHISTBUF	512
  #endif
  
! /* for dbz and ndbz */
  typedef struct {
  	char *dptr;
  	int dsize;
***************
*** 93,135 ****
  	int seen;		/* have we examined current location? */
  	int aborted;		/* has i/o error aborted search? */
  };
! typedef struct dbm {
! 	FILE *dbm_basef;		/* descriptor for base file */
! 	char *dbm_basefname;		/* name for not-yet-opened base file */
! 	FILE *dbm_dirf;			/* descriptor for .dir file */
! 	int dbm_dirronly;		/* dirf open read-only? */
! 	FILE *dbm_pagf;			/* descriptor for .pag file */
! 	of_t dbm_pagpos;		/* posn in pagf; only search may set != -1 */
! 	int dbm_pagronly;		/* pagf open read-only? */
! 	of_t *dbm_corepag;		/* incore version of .pag file, if any */
! 	FILE *dbm_bufpagf;		/* well-buffered pagf, for incore rewrite */
! 	of_t dbm_tagbits;		/* pre-shifted tag mask */
! 	of_t dbm_taghere;		/* pre-shifted tag-enable bit */
! 	of_t dbm_tagboth;		/* tagbits|taghere */
! 	struct dbzconfig dbm_conf;
! 	int dbm_incore;
! 	of_t dbm_pagbuf[NPAGBUF];
! 	char dbm_basebuf[SHISTBUF];
! 	struct searcher dbm_srch;
! 	struct searcher *dbm_prevp;	/* &srch or FRESH */
! 	int dbm_mybmap[SOF];		/* my byte order (see mybytemap()) */
! 	int dbm_bytesame;		/* is database order same as mine? */
! 	int dbm_debug;			/* controlled by dbzdebug() */
! 	int dbm_written;		/* has a store() been done? */
! 	} DBM;
! 
! /* standard dbm functions */
! extern DBM *dbm_open();
! extern datum dbm_fetch();
! extern int dbm_store();
! extern int dbm_delete();	/* not in dbz */
! extern datum dbm_firstkey();	/* not in dbz */
! extern datum dbm_nextkey();	/* not in dbz */
! extern int dbm_close();		/* in dbz, but not in old dbm */
  
  /* new stuff for dbz */
! extern DBM *dbz_fresh();
! extern DBM *dbz_again();
  extern int dbz_sync();
  extern long dbz_size();
  extern int dbz_incore();
--- 98,140 ----
  	int seen;		/* have we examined current location? */
  	int aborted;		/* has i/o error aborted search? */
  };
! typedef struct dbz {
! 	FILE *dbz_basef;		/* descriptor for base file */
! 	char *dbz_basefname;		/* name for not-yet-opened base file */
! 	FILE *dbz_dirf;			/* descriptor for .dir file */
! 	int dbz_dirronly;		/* dirf open read-only? */
! 	FILE *dbz_pagf;			/* descriptor for .pag file */
! 	of_t dbz_pagpos;		/* posn in pagf; only search may set != -1 */
! 	int dbz_pagronly;		/* pagf open read-only? */
! 	of_t *dbz_corepag;		/* incore version of .pag file, if any */
! 	FILE *dbz_bufpagf;		/* well-buffered pagf, for incore rewrite */
! 	of_t dbz_tagbits;		/* pre-shifted tag mask */
! 	of_t dbz_taghere;		/* pre-shifted tag-enable bit */
! 	of_t dbz_tagboth;		/* tagbits|taghere */
! 	struct dbzconfig dbz_conf;
! 	int dbz_incore;
! 	of_t dbz_pagbuf[NPAGBUF];
! 	char dbz_basebuf[SHISTBUF];
! 	struct searcher dbz_srch;
! 	struct searcher *dbz_prevp;	/* &srch or FRESH */
! 	int dbz_mybmap[SOF];		/* my byte order (see mybytemap()) */
! 	int dbz_bytesame;		/* is database order same as mine? */
! 	int dbz_debug;			/* controlled by dbzdebug() */
! 	int dbz_written;		/* has a store() been done? */
! 	} DBZ;
! 
! /* standard dbz functions */
! extern DBZ *dbz_open();
! extern datum dbz_fetch();
! extern int dbz_store();
! extern int dbz_delete();	/* not in dbz */
! extern datum dbz_firstkey();	/* not in dbz */
! extern datum dbz_nextkey();	/* not in dbz */
! extern int dbz_close();		/* in dbz, but not in old dbm */
  
  /* new stuff for dbz */
! extern DBZ *dbz_fresh();
! extern DBZ *dbz_again();
  extern int dbz_sync();
  extern long dbz_size();
  extern int dbz_incore();

Index: lib/mk_aliases.c
Prereq: 5.1
*** ../elm2.4/lib/mk_aliases.c	Sat Oct  3 18:42:26 1992
--- lib/mk_aliases.c	Sat Oct 10 21:47:11 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.2 1992/10/11 01:46:35 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   *			Copyright (c) 1988-1992 USENET Community Trust
   *			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: mk_aliases.c,v $
+  * Revision 5.2  1992/10/11  01:46:35  syd
+  * change dbm name to dbz to avoid conflicts with partial call
+  * ins from shared librarys, and from mixing code with yp code.
+  * From: Syd via prompt from Jess Anderson
+  *
   * Revision 5.1  1992/10/03  22:41:36  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 52,58 ****
  int  err_flag;			/* if errors, don't save!    */
  int  al_count;			/* how many aliases so far?  */
  char msg_buff[SLEN];		/* buffer for error messages */
! DBM  *aliases_hash;             /* current alias file        */
  char *buffer;			/* alias line buffer         */
  long buffer_size;		/* size of alias buffer      */
  long file_offset = 0;		/* offset into file so far   */
--- 57,63 ----
  int  err_flag;			/* if errors, don't save!    */
  int  al_count;			/* how many aliases so far?  */
  char msg_buff[SLEN];		/* buffer for error messages */
! DBZ  *aliases_hash;             /* current alias file        */
  char *buffer;			/* alias line buffer         */
  long buffer_size;		/* size of alias buffer      */
  long file_offset = 0;		/* offset into file so far   */
***************
*** 185,191 ****
  	value.dptr = (char *) &off;
  	value.dsize = sizeof(off);
  
! 	ovalue = dbm_fetch(aliases_hash, key);
  	if (ovalue.dptr != NULL) {
  	    sprintf(msg_buff, catgets(elm_msg_cat,
  	            NewaliasSet, NewaliasDupAlias,
--- 190,196 ----
  	value.dptr = (char *) &off;
  	value.dsize = sizeof(off);
  
! 	ovalue = dbz_fetch(aliases_hash, key);
  	if (ovalue.dptr != NULL) {
  	    sprintf(msg_buff, catgets(elm_msg_cat,
  	            NewaliasSet, NewaliasDupAlias,
***************
*** 195,201 ****
  	    return;
  	}
  
! 	if (dbm_store(aliases_hash, key, value) < 0) {
  	    sprintf(msg_buff, catgets(elm_msg_cat,
  	            NewaliasSet, NewaliasErrWrite,
  		    "** Error writing alias '%s'."), word);
--- 200,206 ----
  	    return;
  	}
  
! 	if (dbz_store(aliases_hash, key, value) < 0) {
  	    sprintf(msg_buff, catgets(elm_msg_cat,
  	            NewaliasSet, NewaliasErrWrite,
  		    "** Error writing alias '%s'."), word);
***************
*** 540,546 ****
  	    return(-1);
  	}
  	else {
! 	    dbm_close(aliases_hash);
  	    fclose(data);
  	    fclose(in);
  	    free(buffer);
--- 545,551 ----
  	    return(-1);
  	}
  	else {
! 	    dbz_close(aliases_hash);
  	    fclose(data);
  	    fclose(in);
  	    free(buffer);

Index: utils/newalias.c
Prereq: 5.1
*** ../elm2.4/utils/newalias.c	Sat Oct  3 20:47:00 1992
--- utils/newalias.c	Sat Oct 10 21:10:42 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: newalias.c,v 5.1 1992/10/04 00:46:45 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: newalias.c,v 5.3 1992/10/11 01:10:31 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log: newalias.c,v $
+  * Revision 5.3  1992/10/11  01:10:31  syd
+  * Add missing setlocale and catopen (just forgotten)
+  * From: Syd
+  *
+  * Revision 5.2  1992/10/11  00:59:39  syd
+  * Fix some compiler warnings that I receive compiling Elm on my SVR4
+  * machine.
+  * From: Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>
+  *
   * Revision 5.1  1992/10/04  00:46:45  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 41,46 ****
--- 50,57 ----
  #include "s_newalias.h"
  #include "sysdefs.h"		/* ELM system definitions */
  
+ void error();
+ 
  #ifdef DEBUG
  FILE *debugfile = stderr;
  int  debug = 0;
***************
*** 56,61 ****
--- 67,78 ----
  	char home_dir[SLEN];		/* the users home directory  */
  	int  a;
  
+ #ifdef I_LOCALE
+ 	setlocale(LC_ALL, "");
+ #endif
+ 
+ 	elm_msg_cat = catopen("elm2.4", 0);
+ 
  	for (a = 1; a < argc; ++a) {
  	  if (strcmp(argv[a], "-g") == 0)
  	    is_system = 1;
***************
*** 103,109 ****
  	/*NOTREACHED*/
  }
  
! int
  error(err_message)
  char *err_message;
  {
--- 120,126 ----
  	/*NOTREACHED*/
  }
  
! void
  error(err_message)
  char *err_message;
  {

Index: Patchlist
*** ../elm2.4/Patchlist	Sat Oct  3 18:12:34 1992
--- Patchlist	Sat Oct 10 22:16:29 1992
***************
*** 1,3 ****
! This file will contain the date and comment header from each
! official patch as issued.  Since this is the full new release,
! there are currently no patches.
--- 1,64 ----
! Patch Set - Patches 1 and 2: Sat Oct 10 22:14:59 EDT 1992
! Elm 2.4PL0 -> Elm 2.4PL2
! 
! Switch to wrapper for flock and fcntl locking.
! Change order to fcntl first, other order blocked.
! From: Jukka Ukkonen <ukkonen@csc.fi>
! 
! Fix some compiler warnings that I receive compiling Elm on my SVR4
! machine.
! From: Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>
! 
! Add AIX to src/curses.c for define of window size in different include
! file.
! From: Syd via note from Tom Kovar
! 
! get_return() assumes that message_count reflects the number of
! messages in the current folder, but the message_count it's seeing
! from the alias subsystem is actually the *alias* count.
! toggle the main state before and after calling get_return().
! From: cliff@sfn.ORG (R. Cliff Young)
! 
! Add missing setlocale and getopen to newalias and listalias.
! From: Syd
! 
! Touchups on config guide
! From: David Barr <barr@pop.psu.edu>
! 
! Fix segv in wildcards if SHELL= has no / character in path
! From: Syd
! 
! 1. If firstname && lastname is null then copy aliasname into the 
! personal name field (inside the ()'s) when creating an alias
! from the menu using the 'n' command.
! 
! 2. Now if for some reason and alias has a null personal name field
! (the person hand edited aliases.text) the blank () is not printed
! as part of the address.  This actually cured another problem, where
! the To: field on the screen (when you hit 'm' on the alias menu)
! used to be blank, now the address shows up....
! From: "Robert L. Howard" <robert.howard@matd.gatech.edu>
! 
! Updated AIX 3.2 section of README file
! From: Syd
! 
! fixed a bug in the .lp macro in doc/tmac.n.  The lp macros is always
! called with a unit specified for the second argument, however, the
! macro added a "n" unit specifier to that argument.  The following patch
! fixes this problem.
! 
! The various .guide books use the troff .tl macro liberally, but often the
! extra ' characters needed at the end of the lines to explicitly specify
! the trailing nulls fields were left off.  The following patch fixes the
! erroneous lines.
! From: Larry Philps <larryp@sco.COM>
! 
! While installing elm2.4 on a Sun4 running SunOS4.1.2, the Configure script
! doesn't recognize F_SETLK because it searches in /usr/include/sys/fcntl.h
! which includes /usr/include/sys/fcntlcom.h (where F_SETLK is).
! From: dax@ulysse.enst.fr (Philippe Dax)
! 
! change dbm name to dbz to avoid conflicts with partial call
! ins from shared librarys, and from mixing code with yp code.
! From: Syd via prompt from Jess Anderson
! 

Index: utils/fastmail.c
Prereq: 5.1
*** ../elm2.4/utils/fastmail.c	Sat Oct  3 20:46:59 1992
--- utils/fastmail.c	Sat Oct 10 20:59:42 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: fastmail.c,v 5.1 1992/10/04 00:46:45 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: fastmail.c,v 5.2 1992/10/11 00:59:39 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: fastmail.c,v $
+  * Revision 5.2  1992/10/11  00:59:39  syd
+  * Fix some compiler warnings that I receive compiling Elm on my SVR4
+  * machine.
+  * From: Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>
+  *
   * Revision 5.1  1992/10/04  00:46:45  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 137,143 ****
  	    assumes that anything the user sends is part of the 
  	    message body unless either:
  		1. the "-s" flag is used (although it doesn't seem
! 		   to be supported on all implementations??)
  		2. the first line is "Subject:".  If so, then it'll
  		   read until a blank line and assume all are meant
  		   to be headers.
--- 142,148 ----
  	    assumes that anything the user sends is part of the 
  	    message body unless either:
  		1. the "-s" flag is used (although it doesn't seem
! 		   to be supported on all implementations?)
  		2. the first line is "Subject:".  If so, then it'll
  		   read until a blank line and assume all are meant
  		   to be headers.

Index: utils/listalias.c
Prereq: 5.1
*** ../elm2.4/utils/listalias.c	Sat Oct  3 20:46:59 1992
--- utils/listalias.c	Sat Oct 10 21:10:43 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: listalias.c,v 5.1 1992/10/04 00:46:45 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: listalias.c,v 5.2 1992/10/11 01:10:31 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log: listalias.c,v $
+  * Revision 5.2  1992/10/11  01:10:31  syd
+  * Add missing setlocale and catopen (just forgotten)
+  * From: Syd
+  *
   * Revision 5.1  1992/10/04  00:46:45  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 42,47 ****
--- 46,57 ----
  	int count = 0, len;
  	char buffer[VERY_LONG_STRING], fd_hash[SLEN], 
  	     fd_data[SLEN], *home;
+ 
+ #ifdef I_LOCALE
+ 	setlocale(LC_ALL, "");
+ #endif
+ 
+ 	elm_msg_cat = catopen("elm2.4", 0);
  
  	if (argc > 2) {
  	  fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasListUsage,

Index: utils/answer.c
Prereq: 5.1
*** ../elm2.4/utils/answer.c	Sat Oct  3 20:46:57 1992
--- utils/answer.c	Sat Oct 10 21:47:13 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: answer.c,v 5.1 1992/10/04 00:46:45 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: answer.c,v 5.3 1992/10/11 01:46:35 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,28 ----
   *
   *******************************************************************************
   * $Log: answer.c,v $
+  * Revision 5.3  1992/10/11  01:46:35  syd
+  * change dbm name to dbz to avoid conflicts with partial call
+  * ins from shared librarys, and from mixing code with yp code.
+  * From: Syd via prompt from Jess Anderson
+  *
+  * Revision 5.2  1992/10/11  01:25:58  syd
+  * Add undefs of tolower so BSD macro isnt used from ctype.h
+  * From: Syd
+  *
   * Revision 5.1  1992/10/04  00:46:45  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 35,44 ****
  #include "sysdefs.h"
  #include <ctype.h>
  
  #define  ELM		"elm"		/* where the elm program lives */
  
  int user_data;		/* fileno of user data file   */
! DBM *hash;		/* dbm file for same */
  
  #ifdef DEBUG
  FILE *debugfile = stderr;
--- 44,57 ----
  #include "sysdefs.h"
  #include <ctype.h>
  
+ #ifdef BSD
+ #undef        tolower
+ #endif
+ 
  #define  ELM		"elm"		/* where the elm program lives */
  
  int user_data;		/* fileno of user data file   */
! DBZ *hash;		/* dbz file for same */
  
  #ifdef DEBUG
  FILE *debugfile = stderr;
***************
*** 280,286 ****
  
  	sprintf(fname,  "%s/.elm/aliases", getenv("HOME")); 
  
! 	if ((hash = dbm_open(fname, O_RDONLY, 0)) == NULL) 
  	  exit(printf("** Fatal Error: Could not open %s!\n", fname));
  
  	if ((user_data = open(fname, O_RDONLY)) == -1) 
--- 293,299 ----
  
  	sprintf(fname,  "%s/.elm/aliases", getenv("HOME")); 
  
! 	if ((hash = dbz_open(fname, O_RDONLY, 0)) == NULL) 
  	  exit(printf("** Fatal Error: Could not open %s!\n", fname));
  
  	if ((user_data = open(fname, O_RDONLY)) == -1) 
***************
*** 306,312 ****
  	name = shift_lower(name);
  	key.dptr = name;
  	key.dsize = strlen(name);
! 	value = dbm_fetch(hash, key);
  	if (value.dptr == NULL)
  	    return( (char *) NULL); /* not found */
  
--- 319,325 ----
  	name = shift_lower(name);
  	key.dptr = name;
  	key.dsize = strlen(name);
! 	value = dbz_fetch(hash, key);
  	if (value.dptr == NULL)
  	    return( (char *) NULL); /* not found */
  

Index: utils/arepdaem.c
Prereq: 5.1
*** ../elm2.4/utils/arepdaem.c	Sat Oct  3 20:46:58 1992
--- utils/arepdaem.c	Sat Oct 10 20:59:41 1992
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: arepdaem.c,v 5.1 1992/10/04 00:46:45 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: arepdaem.c,v 5.2 1992/10/11 00:59:39 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
   *
   * 			Copyright (c) 1988-1992 USENET Community Trust
   * 			Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log: arepdaem.c,v $
+  * Revision 5.2  1992/10/11  00:59:39  syd
+  * Fix some compiler warnings that I receive compiling Elm on my SVR4
+  * machine.
+  * From: Tom Moore <tmoore@fievel.DaytonOH.NCR.COM>
+  *
   * Revision 5.1  1992/10/04  00:46:45  syd
   * Initial checkin as of 2.4 Release at PL0
   *
***************
*** 100,105 ****
--- 105,111 ----
  
  long  bytes();				/*       ditto 		  */
  time_t ModTime();			/*       ditto		  */
+ void read_autoreply_file();
  
  SIGHAND_TYPE	term_signal();
  
***************
*** 179,185 ****
  	}
  }
  
! int
  read_autoreply_file()
  {
  	/** We're here because the autoreply file has changed!!  It
--- 185,191 ----
  	}
  }
  
! void
  read_autoreply_file()
  {
  	/** We're here because the autoreply file has changed!!  It

-- 
========================================================================
Sydney S. Weinstein, CDP, CCP          Elm Coordinator - Current 2.4PL02
Datacomp Systems, Inc.                 Projected 3.0 Release: ??? ?,1994
syd@DSI.COM or dsinc!syd      Voice: (215) 947-9900, FAX: (215) 938-0235
Newsgroups: comp.mail.elm