evince r3339 - in trunk: . properties
- From: carlosgc svn gnome org
- To: svn-commits-list gnome org
- Subject: evince r3339 - in trunk: . properties
- Date: Fri, 16 Jan 2009 09:39:17 +0000 (UTC)
Author: carlosgc
Date: Fri Jan 16 09:39:17 2009
New Revision: 3339
URL: http://svn.gnome.org/viewvc/evince?rev=3339&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/properties/ev-properties-view.c
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Fri Jan 16 09:39:17 2009
@@ -405,6 +405,8 @@
fi
AC_SUBST(EVINCE_MIME_TYPES)
+AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
+
AC_CONFIG_FILES([
backend/Makefile
backend/comics/Makefile
Modified: trunk/properties/ev-properties-view.c
==============================================================================
--- trunk/properties/ev-properties-view.c (original)
+++ trunk/properties/ev-properties-view.c Fri Jan 16 09:39:17 2009
@@ -111,14 +111,19 @@
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]