X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=properties%2Fev-properties-view.c;h=1203157211c0a13a347dbcd6cf93ba0ff14b640f;hb=refs%2Ftags%2FEVINCE_2_25_90;hp=6382af4a7ef5a24831d73355ca6e92e994f7e771;hpb=309a8fb96dd401d07f774c687bda59da77bd41d2;p=evince.git diff --git a/properties/ev-properties-view.c b/properties/ev-properties-view.c index 6382af4a..12031572 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);