Date: Tue, 15 Jun 1999 17:19:47 -0400 (EDT) From: Sam Stephenson <sam@conio.net> To: freebsd-current@freebsd.org, freebsd-stable@freebsd.org Subject: w.c patch for -CURRENT Message-ID: <Pine.BSF.4.05.9906151717290.66181-200000@aeolus>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Here's my w.c patch for -CURRENT. Sorry about the confusion. --Sam Stephenson sam@conio.net [-- Attachment #2 --] 104a105,114 > * UT_LINESIZE is 5 for who output, because the entire terminal device name > * is shown (e.g. ttyp0). Since we only show the 'p0' in w, we'll redefine > * this to 3 to save space. > */ > #ifdef UT_LINESIZE > #undef UT_LINESIZE > #endif > #define UT_LINESIZE 3 > > /* 136c146 < int ch, i, nentries, nusers, wcmd, longidle; --- > int ch, i, nentries, nusers, wcmd, longidle, maxnamelen=5; 215a226,236 > > /* > * Calculate the maxmimum number of spaces needed for > * each username. Previously 16; in 2.2.x and lower, > * when long usernames did not exist, 8 spaces were > * used. To avoid wasted space we will now do this > * dynamically. > */ > if (strlen(utmp.ut_name) > maxnamelen) > maxnamelen = strlen(utmp.ut_name); > 250c271 < #define WUSED (UT_NAMESIZE + UT_LINESIZE + UT_HOSTSIZE + \ --- > #define WUSED (maxnamelen + UT_LINESIZE + UT_HOSTSIZE + \ 253c274 < UT_NAMESIZE, UT_NAMESIZE, HEADER_USER, --- > maxnamelen, maxnamelen, HEADER_USER, 383c404 < UT_NAMESIZE, UT_NAMESIZE, ep->utmp.ut_name, --- > maxnamelen, maxnamelen, ep->utmp.ut_name,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9906151717290.66181-200000>
