]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Made parse function more robust. Dates with one character for day-of-month
authorrousskov <>
Thu, 12 Mar 1998 01:07:22 +0000 (01:07 +0000)
committerrousskov <>
Thu, 12 Mar 1998 01:07:22 +0000 (01:07 +0000)
  (e.g. "Thu, 6 Feb 1997 23:42:24 GMT") are now parsed.

lib/rfc1123.c

index 61122cadb03995f3af500765f93bbdda44ed44e2..9c94f28f6e5f18f5d7154b08fb188b65559aae11 100644 (file)
@@ -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;