From: rousskov <> Date: Thu, 12 Mar 1998 01:07:22 +0000 (+0000) Subject: - Made parse function more robust. Dates with one character for day-of-month X-Git-Tag: SQUID_3_0_PRE1~3866 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=142275161e84433a990361d6373b1bf6fdd7294e;p=thirdparty%2Fsquid.git - Made parse function more robust. Dates with one character for day-of-month (e.g. "Thu, 6 Feb 1997 23:42:24 GMT") are now parsed. --- diff --git a/lib/rfc1123.c b/lib/rfc1123.c index 61122cadb0..9c94f28f6e 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -1,6 +1,6 @@ /* - * $Id: rfc1123.c,v 1.14 1998/02/02 21:16:13 wessels Exp $ + * $Id: rfc1123.c,v 1.15 1998/03/11 18:07:22 rousskov Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -185,8 +185,10 @@ parse_rfc1123(const char *str) memset(&tm, '\0', sizeof(struct tm)); if ((s = strchr(str, ','))) { /* Thursday, 10-Jun-93 01:29:59 GMT */ s++; /* or: Thu, 10 Jan 1993 01:29:59 GMT */ - while (*s && *s == ' ') + while (*s == ' ') s++; + if (isdigit(*s) && !isdigit(*(s+1))) /* backoff if only one digit */ + s--; if (strchr(s, '-')) { /* First format */ if ((int) strlen(s) < 18) return -1;