[comp.bugs.misc] mcp 1.0 patch #6

kyle@xanth.UUCP (kyle jones) (05/07/87)

[ Sorry, gang.  I would have liked these to have been part of patch #5, but
  didn't find out about/fix the bugs in time.  --kyle ]

This patch (#6) makes the following changes in the mcp 1.0 distribution

1)	Fixed bug in update-user.  Mcp would dump core when changing a user's
	base gid if the gid before the change does not have a group attached
	to it.	(thanx to ogion@brandeis.csnet)
2)	Fixed redirection bug.  Every now and then when redirecting mcp output
	to a file, completion information would be erroneously put into the
	file along with the useful output. (thanx to tadguy@xanth.cs.odu.edu)

This patch will not work if patches #1-5 have not been applied.  Patches
#1-2 were applied by Rich Salz before mod.sources distribution, so no one
should need these.  All patches may be obtained from me; send requests to my
e-mail address.

To apply this patch from readnews, vnews or rn, type "s|patch -d -p0 DIR",
with DIR being the directory where the mcp sources and documentation are kept.
Alternately you can save this article and later cd to DIR and "patch -p0 <
thisarticle".  Don't leave off the "-p0".  If you don't have patch (alas!),
you'll have to apply the context diffs below by hand.

kyle jones   <kyle@xanth.cs.odu.edu>
old dominion university, norfolk, va

Prereq: (#5)
Index: src/version.c
*** src/version.c.old	Thu May  7 00:03:28 1987
--- src/version.c	Wed May  6 00:56:24 1987
***************
*** 3,9 ****
  	char	*n_copyright;
  };
  static	struct notice Note = {
! "mcp version 1.0 (#5)  5/1/87",
  "(c) 1986 by Kyle E. Jones\n\n\
  All sources and documentation of this mcp distribution are\n\
  included in this copyright, but permission is granted to\n\
--- 3,9 ----
  	char	*n_copyright;
  };
  static	struct notice Note = {
! "mcp version 1.0 (#6)  5/6/87",
  "(c) 1986 by Kyle E. Jones\n\n\
  All sources and documentation of this mcp distribution are\n\
  included in this copyright, but permission is granted to\n\

Index: src/update.c
*** src/update.c.old	Thu May  7 00:03:31 1987
--- src/update.c	Wed May  6 01:16:55 1987
***************
*** 990,996 ****
  			if (gm->gm_aliases.l_count)
  			    RXBindings(ac);
  			gm = getgmgid(ogid);
! 			for (j=0; j < gm->gm_aliases.l_count; j++) {
  			    al = getalnam((char *)gm->gm_aliases.l_list[j]);
  			    if (!al) continue;	/* trouble */
  			    if (!instrlist(&al->al_addresses, (char *)ac->ac_name)) {
--- 990,997 ----
  			if (gm->gm_aliases.l_count)
  			    RXBindings(ac);
  			gm = getgmgid(ogid);
! 			if (gm)
! 			  for (j=0; j < gm->gm_aliases.l_count; j++) {
  			    al = getalnam((char *)gm->gm_aliases.l_list[j]);
  			    if (!al) continue;	/* trouble */
  			    if (!instrlist(&al->al_addresses, (char *)ac->ac_name)) {
***************
*** 998,1004 ****
  				sort_list(&al->al_addresses, pstrcmp);
  				ModBits |= AL;
  			    }
! 			}
  #endif
  			changed++;
  		}
--- 999,1005 ----
  				sort_list(&al->al_addresses, pstrcmp);
  				ModBits |= AL;
  			    }
! 			  }
  #endif
  			changed++;
  		}

Index: src/complete.c
*** src/complete.c.old	Thu May  7 00:03:35 1987
--- src/complete.c	Wed May  6 17:18:53 1987
***************
*** 588,593 ****
--- 588,594 ----
  			d = dup(1);
  			(void) dup2(DevTty, 1);
  			(void) showlist(c_list, (addr *)exprv);
+ 			(void) fflush(stdout);
  			/*
  			 * Now re-connect stdout to whatever is was before
  			 */
***************
*** 842,847 ****
--- 843,849 ----
  			d = dup(1);
  			(void) dup2(DevTty, 1);
  			(void) showlist(c_list, (addr *)exprv);
+ 			(void) fflush(stdout);
  			/*
  			 * Now re-connect stdout to whatever is was before
  			 */
***************
*** 1087,1092 ****
--- 1089,1095 ----
  			d = dup(1);
  			(void) dup2(DevTty, 1);
  			(void) showlist(&c_list, (addr *)exprv);
+ 			(void) fflush(stdout);
  			/*
  			 * Now re-connect stdout to whatever is was before
  			 */