# HG changeset patch # User Richard Laager # Date 1210481436 0 # Node ID 8dadddab10edd0cbcdc0f4b998eb6ae19a08ed80 # Parent 0bd86dae2734df8cfde580cd17064e724c1c746a Fix purple_str_to_time() to not break the returned value when we have given it a string with a GMT offset (like a log filename). We were setting tm_isdst to 0 when we knew the offset. Apparently, mktime() said, "Umm, yes, it is DST." and fixed it by shifting the hour. The fix is to tell the C library (by setting tm_isdst to -1) that we're sure of the time, but not the DST status. Hopefully this doesn't break any other code path. Fixes #3550 diff -r 0bd86dae2734 -r 8dadddab10ed libpurple/util.c --- a/libpurple/util.c Sun May 11 00:27:18 2008 +0000 +++ b/libpurple/util.c Sun May 11 04:50:36 2008 +0000 @@ -831,9 +831,6 @@ tzoff = tzhrs*60*60 + tzmins*60; if (offset_positive) tzoff *= -1; - /* We don't want the C library doing DST calculations - * if we know the UTC offset already. */ - t.tm_isdst = 0; } else if (utc) { @@ -895,14 +892,11 @@ } } + retval = mktime(&t); + if (tm != NULL) - { *tm = t; - tm->tm_isdst = -1; - mktime(tm); - } - - retval = mktime(&t); + if (tzoff != PURPLE_NO_TZ_OFF) retval += tzoff;