[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.16 and 1.17

version 1.16, 2005/09/25 21:05:04 version 1.17, 2005/12/07 12:31:05
Line 434 
Line 434 
         int v;          int v;
   
         v = (int)strtol(s, &cp, 10);          v = (int)strtol(s, &cp, 10);
         if (cp != s)          if (*cp != '\0') {              /* s wasn't purely numeric */
                 ;                  v = 0;
         else if (strptime(s, "%B", &tm) != NULL)                  if ((cp = strptime(s, "%b", &tm)) != NULL && *cp == '\0')
                 v = tm.tm_mon + 1;                          v = tm.tm_mon + 1;
         else if (strptime(s, "%b", &tm) != NULL)          }
                 v = tm.tm_mon + 1;  
         if (v <= 0 || v > 12)          if (v <= 0 || v > 12)
                 errx(1, "illegal month value: use 1-12");                  errx(1, "invalid month: use 1-12 or a name");
         return (v);          return (v);
 }  }

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17