summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2011-03-07 17:18:40 +0100
committerChristian Dywan <christian@twotoasts.de>2011-03-08 16:01:36 +0100
commitbccef7bca0127621d79f315508dfb1ed66936845 (patch)
treedae1e46397dca5bae1df95051a85b57ae5352912
parent3f85938146c9b7e773fe35fe4f0d25e7121a9ba9 (diff)
downloadlibsoup-bccef7bca0127621d79f315508dfb1ed66936845.tar.gz
Parse month names regardless of case
A test case is added that verifies that this works. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=644048
-rw-r--r--libsoup/soup-date.c2
-rw-r--r--tests/date.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/libsoup/soup-date.c b/libsoup/soup-date.c
index 99ba2f0a..29366558 100644
--- a/libsoup/soup-date.c
+++ b/libsoup/soup-date.c
@@ -294,7 +294,7 @@ parse_month (SoupDate *date, const char **date_string)
int i;
for (i = 0; i < G_N_ELEMENTS (months); i++) {
- if (!strncmp (*date_string, months[i], 3)) {
+ if (!g_ascii_strncasecmp (*date_string, months[i], 3)) {
date->month = i + 1;
*date_string += 3;
while (**date_string == ' ' || **date_string == '-')
diff --git a/tests/date.c b/tests/date.c
index aef9c663..f35c41b6 100644
--- a/tests/date.c
+++ b/tests/date.c
@@ -69,6 +69,7 @@ static const char *ok_dates[] = {
"Sat, 6 Nov 2004 08:09:07 GMT",
"Sat, 06 Nov 2004 08:09:07",
"06 Nov 2004 08:09:07 GMT",
+ "SAT, 06 NOV 2004 08:09:07 +1000",
/* rfc850-date, and broken variants */
"Saturday, 06-Nov-04 08:09:07 GMT",