[BACK]Return to who.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / who

Diff for /src/usr.bin/who/who.c between version 1.9 and 1.10

version 1.9, 2000/03/22 17:07:37 version 1.10, 2001/01/31 17:42:26
Line 75 
Line 75 
 int show_labels;                /* show column labels */  int show_labels;                /* show column labels */
 int show_quick;                 /* quick, names only */  int show_quick;                 /* quick, names only */
   
   #define NAME_WIDTH      8
   #define HOST_WIDTH      32
   
 int  int
 main(argc, argv)  main(argc, argv)
         int argc;          int argc;
Line 131 
Line 134 
   
                         while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) {                          while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) {
                                 if (*usr.ut_name && *usr.ut_line) {                                  if (*usr.ut_name && *usr.ut_line) {
                                         (void)printf("%-*.*s ", UT_NAMESIZE,                                          (void)printf("%-*.*s ", NAME_WIDTH,
                                                 UT_NAMESIZE, usr.ut_name);                                                  UT_NAMESIZE, usr.ut_name);
                                         if ((++count % 8) == 0)                                          if ((++count % 8) == 0)
                                                 (void) printf("\n");                                                  (void) printf("\n");
Line 157 
Line 160 
   
                         while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) {                          while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) {
                                 if (*usr.ut_name && *usr.ut_line) {                                  if (*usr.ut_name && *usr.ut_line) {
                                         (void)printf("%-*.*s ", UT_NAMESIZE,                                          (void)printf("%-*.*s ", NAME_WIDTH,
                                                 UT_NAMESIZE, usr.ut_name);                                                  UT_NAMESIZE, usr.ut_name);
                                         if ((++count % 8) == 0)                                          if ((++count % 8) == 0)
                                                 (void) printf("\n");                                                  (void) printf("\n");
Line 241 
Line 244 
   
         }          }
   
         (void)printf("%-*.*s ", UT_NAMESIZE, UT_NAMESIZE, up->ut_name);          (void)printf("%-*.*s ", NAME_WIDTH, UT_NAMESIZE, up->ut_name);
   
         if (show_term) {          if (show_term) {
                 (void)printf("%c ", state);                  (void)printf("%c ", state);
Line 262 
Line 265 
         }          }
   
         if (*up->ut_host)          if (*up->ut_host)
                 printf("\t(%.*s)", UT_HOSTSIZE, up->ut_host);                  printf("  (%.*s)", HOST_WIDTH, up->ut_host);
         (void)putchar('\n');          (void)putchar('\n');
 }  }
   
 void  void
 output_labels()  output_labels()
 {  {
         (void)printf("%-*.*s ", UT_NAMESIZE, UT_NAMESIZE, "USER");          (void)printf("%-*.*s ", NAME_WIDTH, UT_NAMESIZE, "USER");
   
         if (show_term)          if (show_term)
                 (void)printf("S ");                  (void)printf("S ");
Line 280 
Line 283 
         if (show_idle)          if (show_idle)
                 (void)printf("IDLE  ");                  (void)printf("IDLE  ");
   
         (void)printf("\t%.*s", UT_HOSTSIZE, "FROM");          (void)printf("  %.*s", HOST_WIDTH, "FROM");
   
         (void)putchar('\n');          (void)putchar('\n');
 }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10