diff options
author | Hib Eris <hib@hiberis.nl> | 2009-01-16 09:39:17 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2009-01-16 09:39:17 (GMT) |
commit | 93c67e6f3562e68c04c9b08a97cb9a755d7a1782 (patch) | |
tree | 1f285f06ac276257f67d002c4b4ddc11068c1a6e /properties/ev-properties-view.c | |
parent | 1dc6244c5eadd12ddaea244332699d8f9e59dd79 (diff) |
Check for localtime_r. See bug #339172.
2009-01-16 Hib Eris <hib@hiberis.nl>
* configure.ac:
* properties/ev-properties-view.c:
(ev_properties_view_format_date):
Check for localtime_r. See bug #339172.
svn path=/trunk/; revision=3339
Diffstat (limited to 'properties/ev-properties-view.c')
-rw-r--r-- | properties/ev-properties-view.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/properties/ev-properties-view.c b/properties/ev-properties-view.c index 6382af4..1203157 100644 --- a/properties/ev-properties-view.c +++ b/properties/ev-properties-view.c @@ -111,14 +111,19 @@ static char * ev_properties_view_format_date (GTime utime) { time_t time = (time_t) utime; - struct tm t; char s[256]; const char *fmt_hack = "%c"; size_t len; - +#ifdef HAVE_LOCALTIME_R + struct tm t; if (time == 0 || !localtime_r (&time, &t)) return NULL; - len = strftime (s, sizeof (s), fmt_hack, &t); +#else + struct tm *t; + if (time == 0 || !(t = localtime (&time)) ) return NULL; + len = strftime (s, sizeof (s), fmt_hack, t); +#endif + if (len == 0 || s[0] == '\0') return NULL; return g_locale_to_utf8 (s, -1, NULL, NULL, NULL); |