Package: twitux
Version: 0.61-2
Severity: normal

twitux can not parse when run on the other locale than C/POSIX.
Attached patch modify to setlocale LC_TIME before parsing date field of
message as C and to bring it back after parsing.
Version 0.62 fixes this problem, which prepares locale independent
function strtotime().
A idea to create yet-another function is not better than control locale
proper way.



-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages twitux depends on:
ii gconf2 2.22.0-1 GNOME configuration database syste
ii gnome-keyring 2.22.3-1 GNOME keyring services (daemon and
ii libaspell15 0.60.6-1 GNU Aspell spell-checker runtime l
ii libc6 2.7-13 GNU C Library: Shared libraries
ii libdbus-1-3 1.2.1-3 simple interprocess messaging syst
ii libdbus-glib-1-2 0.76-1 simple interprocess messaging syst
ii libgconf2-4 2.22.0-1 GNOME configuration database syste
ii libglade2-0 1:2.6.2-1 library to load .glade files at ru
ii libglib2.0-0 2.16.5-1 The GLib library of C routines
ii libgnome-keyring0 2.22.3-1 GNOME keyring services library
ii libgtk2.0-0 2.12.11-3 The GTK+ graphical user interface
ii libnotify1 [libnotify1-gtk 0.4.4-3 sends desktop notifications to a n
ii libsexy2 0.1.11-2 collection of additional GTK+ widg
ii libsoup2.4-1 2.4.1-2 an HTTP library implementation in
ii libxml2 2.6.32.dfsg-2 GNOME XML library

twitux recommends no packages.

twitux suggests no packages.

-- no debconf information



-- 
HIroshi Miura
NTT DATA Corp. and IPA OSS center
(株)NTTデータ /(独)情報処理推進機構
三浦広志
--- twitux-0.61/src/twitux-parser.c.keep	2008-09-21 19:39:00.887871871 +0900
+++ twitux-0.61/src/twitux-parser.c	2008-09-21 13:29:50.972771405 +0900
@@ -413,6 +413,7 @@
 	int			 seconds_local;
 	int			 seconds_post;
 	int 		 diff;
+	char		*oldenv;
 	time_t		 t = time(NULL);
 
 	tzset ();
@@ -420,12 +421,14 @@
 	ta->tm_isdst = -1;
 	seconds_local = mktime (ta);
 	
+	oldenv=setlocale(LC_TIME, "C");
 	strptime (datetime, "%a %b %d %T +0000 %Y", &post);
 	post.tm_isdst = -1;
 	seconds_post =  mktime (&post);
+	setlocale(LC_TIME, oldenv);
 
-	diff = seconds_local-seconds_post;
-
+	diff = difftime (seconds_local, seconds_post);
+	
 	if (diff < 0) {
 		return g_strdup (_("1 second ago"));
 	}

Reply via email to