diff options
author | taesub kim <taesub.kim@samsung.com> | 2017-03-22 14:21:38 +0900 |
---|---|---|
committer | taesub kim <taesub.kim@samsung.com> | 2017-03-22 14:22:18 +0900 |
commit | e9bdad71c8277e20607fa1eaf0027d53a0dc1f37 (patch) | |
tree | e260727dc080e910dfea79203509fdc4f32ed852 /lib/parsedate.c | |
parent | 3e62527ed71a7a362d7ec321e7f026edab35f8e2 (diff) | |
download | curl-e9bdad71c8277e20607fa1eaf0027d53a0dc1f37.tar.gz curl-e9bdad71c8277e20607fa1eaf0027d53a0dc1f37.tar.bz2 curl-e9bdad71c8277e20607fa1eaf0027d53a0dc1f37.zip |
Imported Upstream version 7.53.1
Change-Id: I575eb99bf2face4938a57889412327e285116bf3
Diffstat (limited to 'lib/parsedate.c')
-rw-r--r-- | lib/parsedate.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/parsedate.c b/lib/parsedate.c index dfcf855c8..3c783be48 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -80,7 +80,7 @@ #endif #include <curl/curl.h> -#include "rawstr.h" +#include "strcase.h" #include "warnless.h" #include "parsedate.h" @@ -211,7 +211,7 @@ static int checkday(const char *check, size_t len) else what = &Curl_wkday[0]; for(i=0; i<7; i++) { - if(Curl_raw_equal(check, what[0])) { + if(strcasecompare(check, what[0])) { found=TRUE; break; } @@ -228,7 +228,7 @@ static int checkmonth(const char *check) what = &Curl_month[0]; for(i=0; i<12; i++) { - if(Curl_raw_equal(check, what[0])) { + if(strcasecompare(check, what[0])) { found=TRUE; break; } @@ -248,7 +248,7 @@ static int checktz(const char *check) what = tz; for(i=0; i< sizeof(tz)/sizeof(tz[0]); i++) { - if(Curl_raw_equal(check, what->name)) { + if(strcasecompare(check, what->name)) { found=TRUE; break; } @@ -386,15 +386,17 @@ static int parsedate(const char *date, time_t *output) /* a digit */ int val; char *end; + int len=0; if((secnum == -1) && - (3 == sscanf(date, "%02d:%02d:%02d", &hournum, &minnum, &secnum))) { + (3 == sscanf(date, "%02d:%02d:%02d%n", + &hournum, &minnum, &secnum, &len))) { /* time stamp! */ - date += 8; + date += len; } else if((secnum == -1) && - (2 == sscanf(date, "%02d:%02d", &hournum, &minnum))) { + (2 == sscanf(date, "%02d:%02d%n", &hournum, &minnum, &len))) { /* time stamp without seconds */ - date += 5; + date += len; secnum = 0; } else { |