From: Paul Mangan Date: Wed, 8 May 2002 06:31:47 +0000 (+0000) Subject: sync with 0.7.5cvs11 X-Git-Tag: w32-075claws17-0~6 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=f54d85934ac331f14c8fd1bb616a40235e33711f;ds=inline sync with 0.7.5cvs11 --- diff --git a/ChangeLog b/ChangeLog index 7f71c988d..cea870ec3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,16 @@ +2002-05-08 + + * src/procheader.c: procheader_date_parse(): fixed a bug that didn't + parse date string like "Mon,6 May 2002 20:31:12 +0800". + procheader_scan_date_string(): new. Separated string scanning + part from procheader_date_parse(). + 2002-05-07 * src/summary_search.c: summary_search_execute(): unlock while selecting summary row (thanks to Martin Schaaf). + * src/summaryview.c: summary_set_column_titles(): reversed the + direction of the arrow so that it matches with Win/Mac style. 2002-05-02 diff --git a/ChangeLog.claws b/ChangeLog.claws index 092be1d59..b08bbad7a 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,8 @@ +2002-05-08 [paul] 0.7.5claws13 + + * sync with 0.7.5cvs11 + see ChangeLog entry 2002-05-08 + 2002-05-08 [paul] 0.7.5claws12 * src/mainwindow.c diff --git a/ChangeLog.jp b/ChangeLog.jp index 0f8c3459e..11096e13e 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,7 +1,16 @@ +2002-05-08 + + * src/procheader.c: procheader_date_parse(): "Mon,6 May 2002 20:31:12 + +0800" ¤Î¤è¤¦¤ÊÆü»þʸ»úÎó¤ò¥Ñ¡¼¥¹¤Ç¤­¤Ê¤¤¥Ð¥°¤ò½¤Àµ¡£ + procheader_scan_date_string(): ¿·µ¬¡£ procheader_date_parse() ¤«¤é + ʸ»úÎó¥¹¥­¥ã¥óÉôʬ¤òʬΥ¡£ + 2002-05-07 * src/summary_search.c: summary_search_execute(): ¥µ¥Þ¥ê¤Î¹Ô¤òÁªÂò ¤¹¤ë¤È¤­¤Ë¥í¥Ã¥¯¤ò²ò½ü¤¹¤ë¤è¤¦¤Ë¤·¤¿(Martin Schaaf ¤µ¤ó thanks)¡£ + * src/summaryview.c: summary_set_column_titles(): Win/Mac ¤Î¥¹¥¿¥¤¥ë + ¤Ë¹ç¤¦¤è¤¦¤ËÌð°õ¤ÎÊý¸þ¤òµÕ¤Ë¤·¤¿¡£ 2002-05-02 diff --git a/configure.in b/configure.in index f99794173..d2dd06c37 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=7 MICRO_VERSION=5 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws12 +EXTRA_VERSION=claws13 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/procheader.c b/src/procheader.c index 4e95ccff5..93fc862c5 100644 --- a/src/procheader.c +++ b/src/procheader.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2001 Hiroyuki Yamamoto + * Copyright (C) 1999-2002 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -702,6 +702,38 @@ gchar *procheader_get_fromname(const gchar *str) return name; } +static gint procheader_scan_date_string(const gchar *str, + gchar *weekday, gint *day, + gchar *month, gint *year, + gint *hh, gint *mm, gint *ss, + gchar *zone) +{ + gint result; + + result = sscanf(str, "%10s %d %9s %d %2d:%2d:%2d %5s", + weekday, day, month, year, hh, mm, ss, zone); + if (result == 8) return 0; + + result = sscanf(str, "%3s,%d %9s %d %2d:%2d:%2d %5s", + weekday, day, month, year, hh, mm, ss, zone); + if (result == 8) return 0; + + result = sscanf(str, "%d %9s %d %2d:%2d:%2d %5s", + day, month, year, hh, mm, ss, zone); + if (result == 7) return 0; + + *ss = 0; + result = sscanf(str, "%10s %d %9s %d %2d:%2d %5s", + weekday, day, month, year, hh, mm, zone); + if (result == 7) return 0; + + result = sscanf(str, "%d %9s %d %2d:%2d %5s", + day, month, year, hh, mm, zone); + if (result == 6) return 0; + + return -1; +} + time_t procheader_date_parse(gchar *dest, const gchar *src, gint len) { static gchar monthstr[] = "JanFebMarAprMayJunJulAugSepOctNovDec"; @@ -711,34 +743,17 @@ time_t procheader_date_parse(gchar *dest, const gchar *src, gint len) gint year; gint hh, mm, ss; gchar zone[6]; - gint result; GDateMonth dmonth; struct tm t; gchar *p; time_t timer; - /* parsing date field... */ - result = sscanf(src, "%10s %d %9s %d %2d:%2d:%2d %5s", - weekday, &day, month, &year, &hh, &mm, &ss, zone); - if (result != 8) { - result = sscanf(src, "%d %9s %d %2d:%2d:%2d %5s", - &day, month, &year, &hh, &mm, &ss, zone); - if (result != 7) { - ss = 0; - result = sscanf(src, "%10s %d %9s %d %2d:%2d %5s", - weekday, &day, month, &year, &hh, &mm, zone); - if (result != 7) { - result = sscanf(src, "%d %9s %d %2d:%2d %5s", - &day, month, &year, &hh, &mm, - zone); - if (result != 6) { - g_warning("Invalid date: %s\n", src); - if (dest && len > 0) - strncpy2(dest, src, len); - return 0; - } - } - } + if (procheader_scan_date_string(src, weekday, &day, month, &year, + &hh, &mm, &ss, zone) < 0) { + g_warning("Invalid date: %s\n", src); + if (dest && len > 0) + strncpy2(dest, src, len); + return 0; } /* Y2K compliant :) */