=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/who/who.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/who/who.c 2000/03/21 21:54:51 1.8 --- src/usr.bin/who/who.c 2000/03/22 17:07:37 1.9 *************** *** 1,4 **** ! /* $OpenBSD: who.c,v 1.8 2000/03/21 21:54:51 ericj Exp $ */ /* $NetBSD: who.c,v 1.4 1994/12/07 04:28:49 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: who.c,v 1.9 2000/03/22 17:07:37 millert Exp $ */ /* $NetBSD: who.c,v 1.4 1994/12/07 04:28:49 jtc Exp $ */ /* *************** *** 47,57 **** #if 0 static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: who.c,v 1.8 2000/03/21 21:54:51 ericj Exp $"; #endif /* not lint */ #include #include #include #include #include --- 47,58 ---- #if 0 static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: who.c,v 1.9 2000/03/22 17:07:37 millert Exp $"; #endif /* not lint */ #include #include + #include #include #include #include *************** *** 116,128 **** only_current_term = show_term = show_idle = show_labels = 0; } - if (show_term || show_idle) { - if (chdir("/dev")) { - err(1, "cannot change directory to /dev"); - /* NOTREACHED */ - } - } - if (show_labels) output_labels(); --- 117,122 ---- *************** *** 225,231 **** struct utmp *up; { struct stat sb; ! char line[sizeof (up->ut_line) + 1]; char state = '?'; static time_t now = 0; time_t idle = 0; --- 219,225 ---- struct utmp *up; { struct stat sb; ! char line[sizeof(_PATH_DEV) + sizeof (up->ut_line)]; char state = '?'; static time_t now = 0; time_t idle = 0; *************** *** 234,241 **** if (now == 0) time(&now); ! strncpy(line, up->ut_line, sizeof (up->ut_line)); ! line[sizeof (up->ut_line)] = '\0'; if (stat(line, &sb) == 0) { state = (sb.st_mode & 020) ? '+' : '-'; --- 228,235 ---- if (now == 0) time(&now); ! strcpy(line, _PATH_DEV); ! strncat(line, up->ut_line, sizeof (up->ut_line)); if (stat(line, &sb) == 0) { state = (sb.st_mode & 020) ? '+' : '-';