[comp.os.minix] lib/getpwent.c

andy@cheviot.UUCP (04/09/87)

*** getpwent.c	Mon Feb 23 11:49:27 1987
--- /tmp/getpwent.c	Thu Apr  9 13:54:00 1987
***************
*** 75,93 ****
  	if (getline () == 0)
  		return (0);
  
! 	pwd.name = _buf;
  	skip_period ();
! 	pwd.passwd = _buf;
  	skip_period ();
! 	pwd.uid = atoi (_buf);
  	skip_period ();
! 	pwd.gid = atoi (_buf);
  	skip_period ();
! 	pwd.gecos = _buf;
  	skip_period ();
! 	pwd.dir = _buf;
  	skip_period ();
! 	pwd.shell = _buf;
  
  	return (&pwd);
  }
--- 75,93 ----
  	if (getline () == 0)
  		return (0);
  
! 	pwd.pw_name = _buf;
  	skip_period ();
! 	pwd.pw_passwd = _buf;
  	skip_period ();
! 	pwd.pw_uid = atoi (_buf);
  	skip_period ();
! 	pwd.pw_gid = atoi (_buf);
  	skip_period ();
! 	pwd.pw_gecos = _buf;
  	skip_period ();
! 	pwd.pw_dir = _buf;
  	skip_period ();
! 	pwd.pw_shell = _buf;
  
  	return (&pwd);
  }
***************
*** 99,105 ****
  
  	setpwent ();
  	while ((pwd = getpwent ()) != 0)
! 		if (!strcmp (pwd -> name, name))
  			break;
  	endpwent ();
  	if (pwd != 0)
--- 99,105 ----
  
  	setpwent ();
  	while ((pwd = getpwent ()) != 0)
! 		if (!strcmp (pwd -> pw_name, name))
  			break;
  	endpwent ();
  	if (pwd != 0)
***************
*** 115,121 ****
  
  	setpwent ();
  	while ((pwd = getpwent ()) != 0)
! 		if (pwd -> uid == uid)
  			break;
  	endpwent ();
  	if (pwd != 0)
--- 115,121 ----
  
  	setpwent ();
  	while ((pwd = getpwent ()) != 0)
! 		if (pwd -> pw_uid == uid)
  			break;
  	endpwent ();
  	if (pwd != 0)

-- 
SENDER 	: Andy Linton 			PHONE	: +44 91 232 9233
ARPA	: andy%cheviot.newcastle.ac.uk@cs.ucl.ac.uk
JANET	: andy@uk.ac.newcastle.cheviot
UUCP	: andy@cheviot.UUCP