comparison libpurple/util.c @ 27839:7b8f5dd30a82

propagate from branch 'im.pidgin.pidgin' (head fbc907b599705ebe499000ee228b8be4c456b39b) to branch 'im.pidgin.pidgin.yaz' (head 43e95be75f8daf1a5fbefd025917efbdc2382611)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 15 May 2008 13:29:11 +0000
parents f9fd7ddf6996 8dadddab10ed
children acef4202e147
comparison
equal deleted inserted replaced
27838:22f8b5512ef4 27839:7b8f5dd30a82
829 (sscanf(c, "%02d%02d", &tzhrs, &tzmins) == 2 && (c = c + 4)))) 829 (sscanf(c, "%02d%02d", &tzhrs, &tzmins) == 2 && (c = c + 4))))
830 { 830 {
831 tzoff = tzhrs*60*60 + tzmins*60; 831 tzoff = tzhrs*60*60 + tzmins*60;
832 if (offset_positive) 832 if (offset_positive)
833 tzoff *= -1; 833 tzoff *= -1;
834 /* We don't want the C library doing DST calculations
835 * if we know the UTC offset already. */
836 t.tm_isdst = 0;
837 } 834 }
838 else if (utc) 835 else if (utc)
839 { 836 {
840 static struct tm tmptm; 837 static struct tm tmptm;
841 time_t tmp; 838 time_t tmp;
893 if (rest != NULL && *c != '\0') 890 if (rest != NULL && *c != '\0')
894 *rest = c; 891 *rest = c;
895 } 892 }
896 } 893 }
897 894
895 retval = mktime(&t);
896
898 if (tm != NULL) 897 if (tm != NULL)
899 {
900 *tm = t; 898 *tm = t;
901 tm->tm_isdst = -1; 899
902 mktime(tm);
903 }
904
905 retval = mktime(&t);
906 if (tzoff != PURPLE_NO_TZ_OFF) 900 if (tzoff != PURPLE_NO_TZ_OFF)
907 retval += tzoff; 901 retval += tzoff;
908 902
909 if (tz_off != NULL) 903 if (tz_off != NULL)
910 *tz_off = tzoff; 904 *tz_off = tzoff;