Package: twitux
Version: 0.61-2
Severity: normal

twitux cannot parse date field of message on the other locale
than C/POSIX.
When parsing, strptime() fails.
An attached patch fixes it by inserting setlocale(LC_TIME) 
before strptime(). 


-- 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
--- src/twitux-parser.c.keep    2008-09-21 13:30:42.992771264 +0900
+++ src/twitux-parser.c 2008-09-21 13:29:50.972771405 +0900
@@ -421,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