[net.bugs.4bsd] Mail 2.12 alternates bug and fix

alb (02/28/83)

Mail 2.12 does not handle the alternates as well as it can; it
is much too literal about it.  If you have bar!bletch as one
of your alternates and mail comes to you as foo!bar!bletch,
Mail won't match it up with the arguments and will end up
replying back to you as well though you didn't want it to.
Here is the fix to names.c to take care of this (for those of
you without strchr(), use index() instead):

*** onames.c	Sun Feb 27 13:15:49 1983
--- names.c	Sun Feb 27 14:44:03 1983
***************
*** 8,14
  
  #include "rcv.h"
  
! static char *SccsId = "@(#)names.c	2.5 2/26/82";
  
  /*
   * Allocate a single element of a name list,

--- 8,14 -----
  
  #include "rcv.h"
  
! static char *SccsId = "@(#)names.c	2.6 2/27/83";
  
  /*
   * Allocate a single element of a name list,
***************
*** 776,781
  	register struct name *np;
  	char name[];
  {
  	register struct name *p;
  
  	for (p = np; p != NIL; p = p->n_flink)

--- 776,782 -----
  	register struct name *np;
  	char name[];
  {
+ 	char *strchr();
  	register struct name *p;
  
  	for (p = np; p != NIL; p = p->n_flink)
***************
*** 779,785
  	register struct name *p;
  
  	for (p = np; p != NIL; p = p->n_flink)
! 		if (icequal(p->n_name, name)) {
  			if (p->n_blink == NIL) {
  				if (p->n_flink != NIL)
  					p->n_flink->n_blink = NIL;

--- 780,789 -----
  	register struct name *p;
  
  	for (p = np; p != NIL; p = p->n_flink)
! 		if ((strchr(name, '!') && strlen(p->n_name) >= strlen(name) &&
! 		    icequal(p->n_name + (strlen(p->n_name) - strlen(name)),
! 			    name)) ||
! 		    (!strchr(name, '!') && icequal(p->n_name, name))) {
  			if (p->n_blink == NIL) {
  				if (p->n_flink != NIL)
  					p->n_flink->n_blink = NIL;