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

Diff for /src/usr.bin/cal/cal.c between version 1.14 and 1.15

version 1.14, 2005/07/06 06:45:58 version 1.15, 2005/08/24 05:19:41
Line 429 
Line 429 
 int  int
 parsemonth(const char *s)  parsemonth(const char *s)
 {  {
         int v;  
         char *cp;  
         struct tm tm;          struct tm tm;
           char *cp;
           int v;
   
         v = (int)strtol(s, &cp, 10);          v = (int)strtol(s, &cp, 10);
         if (cp != s)          if (cp != s)
                 return (v);                  ;
         if (strptime(s, "%B", &tm) != NULL)          else if (strptime(s, "%B", &tm) != NULL)
                 return (tm.tm_mon + 1);                  v = tm.tm_mon + 1;
         if (strptime(s, "%b", &tm) != NULL)          else if (strptime(s, "%b", &tm) != NULL)
                 return (tm.tm_mon + 1);                  v = tm.tm_mon + 1;
         return (0);          if (v <= 0 || v > 12)
                   errx(1, "illegal month value: use 1-12");
           return (v);
 }  }

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15