15b546ee23
changes: -fix a crash when selecting news bins -add compatibility with non-standard "xmlURL" OPML attributes used by LiveJournal -bugfixes
34 lines
1.3 KiB
Text
34 lines
1.3 KiB
Text
$NetBSD: patch-ae,v 1.4 2008/02/03 11:14:27 drochner Exp $
|
|
|
|
--- src/common.c.orig 2008-01-13 02:07:10.000000000 +0100
|
|
+++ src/common.c
|
|
@@ -273,9 +273,9 @@ gchar *dayofweek[] = { "Sun", "Mon", "Tu
|
|
gchar *months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
|
|
|
gchar *createRFC822Date(const time_t *time) {
|
|
- struct tm *tm;
|
|
+ struct tm *tm, tmbuf;
|
|
|
|
- tm = gmtime(time); /* No need to free because it is statically allocated */
|
|
+ tm = gmtime_r(time, &tmbuf); /* No need to free because it is statically allocated */
|
|
return g_strdup_printf("%s, %2d %s %4d %02d:%02d:%02d GMT", dayofweek[tm->tm_wday], tm->tm_mday,
|
|
months[tm->tm_mon], 1900 + tm->tm_year, tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
}
|
|
@@ -325,7 +325,7 @@ static time_t common_parse_rfc822_tz(cha
|
|
|
|
/* converts a RFC822 time string to a time_t value */
|
|
time_t parseRFC822Date(gchar *date) {
|
|
- struct tm tm;
|
|
+ struct tm tm, t2buf;
|
|
time_t t, t2;
|
|
char *oldlocale;
|
|
char *pos;
|
|
@@ -373,7 +373,7 @@ time_t parseRFC822Date(gchar *date) {
|
|
correction. (Usually, there is no daylight savings
|
|
time since the input is GMT.) */
|
|
t = t - common_parse_rfc822_tz(pos);
|
|
- t2 = mktime(gmtime(&t));
|
|
+ t2 = mktime(gmtime_r(&t, &t2buf));
|
|
t = t - (t2 - t);
|
|
return t;
|
|
} else {
|