[BACK]Return to strings.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/Attic/strings.c between version 1.10 and 1.11

version 1.10, 2009/01/20 13:49:36 version 1.11, 2009/01/20 22:55:46
Line 124  time_t
Line 124  time_t
 mdoc_atotime(const char *p)  mdoc_atotime(const char *p)
 {  {
         struct tm        tm;          struct tm        tm;
           char            *pp;
   
         (void)memset(&tm, 0, sizeof(struct tm));          (void)memset(&tm, 0, sizeof(struct tm));
   
         if (0 == strptime(p, "%b %d %Y", &tm))          if (xstrcmp(p, "$Mdocdate$"))
                   return(time(NULL));
           if ((pp = strptime(p, "$Mdocdate$", &tm)) && 0 == *pp)
                 return(mktime(&tm));                  return(mktime(&tm));
         if (0 == strptime(p, "%b %d, %Y", &tm))          /* XXX - this matches "June 1999", which is wrong. */
           if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp)
                   return(mktime(&tm));
           if ((pp = strptime(p, "%b %d, %Y", &tm)) && 0 == *pp)
                 return(mktime(&tm));                  return(mktime(&tm));
   
         return(0);          return(0);

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

CVSweb