ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/misc.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/misc.c (file contents):
Revision 6500 by michael, Sat Sep 5 17:55:15 2015 UTC vs.
Revision 6513 by michael, Sun Sep 6 18:32:38 2015 UTC

# Line 79 | Line 79 | date_iso8601(time_t lclock)
79   * Thu Nov 24 18:22:48 1986
80   */
81   const char *
82 < myctime(time_t lclock)
82 > date_ctime(time_t lclock)
83   {
84    static char buf[MAX_DATE_STRING];
85    static time_t lclock_last;
86  char *p;
86  
87    if (!lclock)
88      lclock = CurrentTime;
89  
90 <  if (lclock_last == lclock)
91 <    return buf;
90 >  if (lclock_last != lclock)
91 >  {
92 >    lclock_last = lclock;
93 >    strftime(buf, sizeof(buf), "%a %b %-e %T %Y", localtime(&lclock));
94 >  }
95  
94  lclock_last = lclock;
95  strlcpy(buf, ctime(&lclock), sizeof(buf));
96
97  if ((p = strchr(buf, '\n')))
98    *p = '\0';
96    return buf;
97   }
98  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)