[Goodies-dev] [Bug 13358] New: xfce4-weather-plugin shows local times in UTC instead of current timezone

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Fri Feb 17 14:21:50 CET 2017


https://bugzilla.xfce.org/show_bug.cgi?id=13358

            Bug ID: 13358
           Summary: xfce4-weather-plugin shows local times in UTC instead
                    of current timezone
    Classification: Panel Plugins
           Product: Xfce4-weather-plugin
           Version: 0.8.9
          Hardware: Other
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: General
          Assignee: hjudt at xfce.org
          Reporter: alex at zagrebin.ru
                CC: goodies-dev at xfce.org
  Target Milestone: ---

Created attachment 7002
  --> https://bugzilla.xfce.org/attachment.cgi?id=7002&action=edit
patch

I've noticed, that the xfce4-weather-plugin always shows local times in UTC
instead of my local timezone.

The reason is in function my_timegm() (weather-parsers.c).
This function attempts to keep a current timezone, obtained with a call to
g_getenv(), changes a timezone to UTC via g_setenv(), and then restores a
current timezone to early saved one.

But at least on FreeBSD there is a problem:
g_getenv returns a pointer to the area, where system stores the environment. So
my_timegm() keeps for a later use a pointer to current value of the TZ
environment variable. A subsequent call to g_setenv() changes value of the TZ
variable in-place, so now the saved pointer refers to a value which was set by
g_setenv(), but not to a previous timezone. As result an attempt to restore
current timezone does nothing.

The attached patch resolves a problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Goodies-dev mailing list