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

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

version 1.9, 2003/07/10 00:06:50 version 1.10, 2004/03/15 02:50:29
Line 34 
Line 34 
   
 #ifndef lint  #ifndef lint
 /*static char sccsid[] = "from: @(#)sprint.c    5.8 (Berkeley) 12/4/90";*/  /*static char sccsid[] = "from: @(#)sprint.c    5.8 (Berkeley) 12/4/90";*/
 static char rcsid[] = "$OpenBSD$";  static const char rcsid[] = "$OpenBSD$";
 #endif /* not lint */  #endif /* not lint */
   
 #include <sys/types.h>  #include <sys/types.h>
Line 143 
Line 143 
         for (lp = list, pn = phead; pn != NULL; pn = pn->next)          for (lp = list, pn = phead; pn != NULL; pn = pn->next)
                 *lp++ = pn;                  *lp++ = pn;
         (void)qsort(list, entries, sizeof(PERSON *), psort);          (void)qsort(list, entries, sizeof(PERSON *), psort);
         return(list);          return (list);
 }  }
   
 int  int
 psort(const void *p, const void *t)  psort(const void *p, const void *t)
 {  {
         return(strcmp((*(PERSON **)p)->name, (*(PERSON **)t)->name));          return (strcmp((*(PERSON **)p)->name, (*(PERSON **)t)->name));
 }  }
   
 void  void
Line 158 
Line 158 
         struct tm *delta;          struct tm *delta;
   
         delta = gmtime(&w->idletime);          delta = gmtime(&w->idletime);
         if (!delta->tm_yday)          if (!delta->tm_yday) {
                 if (!delta->tm_hour)                  if (!delta->tm_hour) {
                         if (!delta->tm_min)                          if (!delta->tm_min)
                                 (void)printf("    -");                                  (void)printf("    -");
                         else                          else
                                 (void)printf("%5d", delta->tm_min);                                  (void)printf("%5d", delta->tm_min);
                 else                   } else {
                         (void)printf("%2d:%02d",                          (void)printf("%2d:%02d",
                             delta->tm_hour, delta->tm_min);                              delta->tm_hour, delta->tm_min);
         else                   }
           } else
                 (void)printf("%4dd", delta->tm_yday);                  (void)printf("%4dd", delta->tm_yday);
 }  }

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