[comp.bugs.4bsd] uulog doesn't match system or user names greater than 7 chars +Fix

gww@marduk.UUCP (Gary Winiger) (09/05/87)

Subject: Uulog doesn't match a system/user name greater than 7 chars +Fix
Index:	usr.bin/uucp/uulog.c 4.3BSD +Fix

Description:
	If uulog is called with a system or user name greater than 7
	characters, it won't find a match.
Repeat-By:
	uulog -s longsystemname
	Where longsystemname is a valid system that is in the log file.
Fix:
	The log file has system/user names truncated to 7 characters,
	while the user may think of them as longer.  
	The attached code solves this problem at Elxsi.

Gary..
{ucbvax!sun,lll-lcc!lll-tis,amdahl!altos86,bridge2}!elxsi!gww
--------- cut --------- snip --------- :.,$w diff -------------
*** /tmp/,RCSt1001240	Wed Jul  1 17:55:49 1987
--- uulog.c	Wed Jul  1 17:55:28 1987
***************
*** 1,11 ****
  /*
   * $Log:	uulog.c,v $
   * Revision 1.1  87/06/23  16:58:34  gww
   * Initial revision
   * 
   */
  #ifndef lint
! static char *ERcsId = "$Header: uulog.c,v 1.1 87/06/23 16:58:34 gww Exp $ ENIX BSD";
  static char sccsid[] = "@(#)uulog.c	5.4 (Berkeley) 6/23/85";
  #endif
  
--- 1,14 ----
  /*
   * $Log:	uulog.c,v $
+  * Revision 1.2  87/07/01  17:54:41  gww
+  * Check for user/system match when over 7 characters.
+  * 
   * Revision 1.1  87/06/23  16:58:34  gww
   * Initial revision
   * 
   */
  #ifndef lint
! static char *ERcsId = "$Header: uulog.c,v 1.2 87/07/01 17:54:41 gww Exp $ ENIX BSD";
  static char sccsid[] = "@(#)uulog.c	5.4 (Berkeley) 6/23/85";
  #endif
  
***************
*** 83,91 ****
  	ASSERT(plogf != NULL, "CAN NOT OPEN", LOGFILE, 0);
  	while (fgets(buf, BUFSIZ, plogf) != NULL) {
  		sscanf(buf, "%s%s", u, s);
! 		if (user != NULL && !prefix(user, u))
  			continue;
! 		if (sys != NULL && !prefix(sys, s))
  			continue;
  		fputs(buf, stdout);
  		fflush(stdout);
--- 86,94 ----
  	ASSERT(plogf != NULL, "CAN NOT OPEN", LOGFILE, 0);
  	while (fgets(buf, BUFSIZ, plogf) != NULL) {
  		sscanf(buf, "%s%s", u, s);
! 		if (user != NULL && !(prefix(user, u) || prefix(u, user)))
  			continue;
! 		if (sys != NULL && !(prefix(sys, s) || prefix(s, sys)))
  			continue;
  		fputs(buf, stdout);
  		fflush(rs17#ifnd