• Bug#265774: irssi-text: ``21:06 -!- idle : 1 day*s* 1 hour*s* 1 min*s*

    From Jan Minar@1:229/2 to All on Sat Aug 14 23:40:07 2004
    From: [email protected]

    Package: irssi-text
    Version: 0.8.4-3.1
    Severity: minor

    The version in sarge is affected, too.

    What English is this?:

    21:06 -!- idle : 1 day*s* 1 hour*s* 1 min*s* 1 sec*s*

    I wonder when people start realizing that these things are to be coded
    like this:

    printf("%d day%s", days, days == 1 ? "" : "s");

    (Cf. the gettext manual for explanation of how to combine this and
    l10n.)

    Jan.

    -- System Information
    Debian Release: 3.0
    Architecture: i386
    Kernel: Linux kontryhel 2.4.26-jan #6 SMP Tue Jul 27 21:24:30 CEST 2004 i686 Locale: LANG=C, LC_CTYPE=cs_CZ.ISO-8859-2

    Versions of packages irssi-text depends on:
    ii libc6 2.2.5-11.5 GNU C Library: Shared libraries an ii libglib1.2 1.2.10-4 The GLib library of C routines
    ii libncurses5 5.2.20020112a-7 Shared libraries for terminal hand ii libperl5.6 5.6.1-8.7 Shared Perl library.

    --
    "To me, clowns aren't funny. In fact, they're kind of scary. I've wondered
    where this started and I think it goes back to the time I went to the circus,
    and a clown killed my dad."

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.0.6 (GNU/Linux)
    Comment: For info see http://www.gnupg.org

    iD8DBQFBHoM3+uczK20Fa5cRAmkXAKC4LM4K7cs3OrX2v21TGZm46gg8OACg4vNf IqLcd1qdllh8zoN5hPB2DlM=
    =QYbQ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Jan Minar@1:229/2 to David Pashley on Sun Aug 15 19:30:10 2004
    From: [email protected]

    On Sun, Aug 15, 2004 at 11:21:51AM +0100, David Pashley wrote:
    On Aug 14, 2004 at 22:25, Jan Minar praised the llamas by saying:
    What English is this?:

    21:06 -!- idle : 1 day*s* 1 hour*s* 1 min*s* 1 sec*s*

    I wonder when people start realizing that these things are to be coded
    like this:

    printf("%d day%s", days, days == 1 ? "" : "s");

    (Cf. the gettext manual for explanation of how to combine this and
    l10n.)

    Jan.

    This string is returned by the ircd and is not a bug in irssi.

    Wrong.

    http://www.faqs.org/rfcs/rfc2812.html

    This document describes the idle response format:

    RFC2812> 317 RPL_WHOISIDLE
    RFC2812> "<nick> <integer> :seconds idle"

    Let's look at how the response looks on-the-wire:

    % tcpdump -w irc.dump -s0 host irc.freenode.org &>/dev/null &
    % { strings | grep version | head -n1; } < irc.tcpdump
    :zelazny.freenode.net 002 rdancer_ :Your host is zelazny.freenode.net[zelazny.freenode.net/6667], running version dancer-ircd-1.0.35
    % { strings | grep idle; } < irc.tcpdump
    :zelazny.freenode.net 317 rdancer_ rdancer 24221 1092500500 :seconds idle, signon time
    :zelazny.freenode.net 317 rdancer_ rdancer_ 28 1092579371 :seconds idle, signon time
    :zelazny.freenode.net 317 rdancer_ rdancer_ 28 1092579371 :seconds idle, signon time
    :zelazny.freenode.net 317 rdancer_ rdancer_ 40 1092579371 :seconds idle, signon time
    :zelazny.freenode.net 317 rdancer_ rdancer_ 60 1092579371 :seconds idle, signon time
    :zelazny.freenode.net 317 rdancer_ rdancer_ 66 1092579371 :seconds idle, signon time


    It wasn't the easiest task I ever undertook, but here are the gullible
    format strings (note that there are other occasions when the plural form
    is incorrectly used, not only the idle info):

    % grep secs /home/jan/chr/code/irssi-text-0.8.9/src/fe-common/irc/module-formats.c
    { "banlist_long", "$0 - {channel $1}: ban {ban $2} {comment by {nick $3}, $4 secs ago}", 5, { 1, 0, 0, 0, 1 } },
    { "ebanlist_long", "{channel $0}: ban exception {ban $1} {comment by {nick $2}, $3 secs ago}", 4, { 0, 0, 0, 1 } },
    { "channel_synced", "Join to {channel $0} was synced in {hilight $1} secs", 2, { 0, 2 } },
    { "whois_idle", "{whois idle %|$1 days $2 hours $3 mins $4 secs}", 5, { 0, 1, 1, 1, 1 } },
    { "whois_idle_signon", "{whois idle %|$1 days $2 hours $3 mins $4 secs {comment signon: $5}}", 6, { 0, 1, 1, 1, 1, 0 } },

    I have no idea what language they are written in, or they would have been
    fixed by now.

    Cheers,
    Jan.

    --
    "To me, clowns aren't funny. In fact, they're kind of scary. I've wondered
    where this started and I think it goes back to the time I went to the circus,
    and a clown killed my dad."

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.0.6 (GNU/Linux)
    Comment: For info see http://www.gnupg.org

    iD8DBQFBH5ad+uczK20Fa5cRAhdOAJ4vY2xlqZBJSlFuG+zHL2lIDfZdBACeIG1E vb4b9tAh0tBArYr+K95VbpI=
    =trlL
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)