aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--protocols/jabber/jabber_util.c11
-rw-r--r--tests/check_jabber_util.c9
2 files changed, 14 insertions, 6 deletions
diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c
index a0266d3e..db5944bc 100644
--- a/protocols/jabber/jabber_util.c
+++ b/protocols/jabber/jabber_util.c
@@ -3,7 +3,7 @@
* BitlBee - An IRC to IM gateway *
* Jabber module - Misc. stuff *
* *
-* Copyright 2006 Wilmer van der Gaast <wilmer@gaast.net> *
+* Copyright 2006-2010 Wilmer van der Gaast <wilmer@gaast.net>
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -555,7 +555,7 @@ struct jabber_buddy *jabber_buddy_by_ext_jid( struct im_connection *ic, char *ji
int jabber_buddy_remove( struct im_connection *ic, char *full_jid_ )
{
struct jabber_data *jd = ic->proto_data;
- struct jabber_buddy *bud, *prev, *bi;
+ struct jabber_buddy *bud, *prev = NULL, *bi;
char *s, *full_jid;
full_jid = jabber_normalize( full_jid_ );
@@ -566,7 +566,7 @@ int jabber_buddy_remove( struct im_connection *ic, char *full_jid_ )
if( ( bud = g_hash_table_lookup( jd->buddies, full_jid ) ) )
{
if( bud->next )
- bud = bud->next;
+ bud = (prev=bud)->next;
/* If there's only one item in the list (and if the resource
matches), removing it is simple. (And the hash reference
@@ -586,7 +586,7 @@ int jabber_buddy_remove( struct im_connection *ic, char *full_jid_ )
}
else
{
- for( bi = bud, prev = NULL; bi; bi = (prev=bi)->next )
+ for( bi = bud; bi; bi = (prev=bi)->next )
if( strcmp( bi->resource, s + 1 ) == 0 )
break;
@@ -597,8 +597,7 @@ int jabber_buddy_remove( struct im_connection *ic, char *full_jid_ )
if( prev )
prev->next = bi->next;
else
- /* The hash table should point at the second
- item, because we're removing the first. */
+ /* Don't think this should ever happen anymore. */
g_hash_table_replace( jd->buddies, bi->bare_jid, bi->next );
g_free( bi->ext_jid );
diff --git a/tests/check_jabber_util.c b/tests/check_jabber_util.c
index 47e1e1a0..bf6d3e60 100644
--- a/tests/check_jabber_util.c
+++ b/tests/check_jabber_util.c
@@ -83,6 +83,15 @@ static void check_buddy_add(int l)
fail_if( jabber_buddy_remove( ic, "nekkid@lamejab.net/Illegal" ) );
fail_unless( jabber_buddy_remove( ic, "nekkid@lamejab.net" ) );
fail_if( jabber_buddy_by_jid( ic, "nekkid@lamejab.net", 0 ) );
+
+ /* Fixing a bug in this branch that caused information to get lost when
+ removing the first full JID from a list. */
+ jabber_buddy_add( ic, "bugtest@google.com/A" );
+ jabber_buddy_add( ic, "bugtest@google.com/B" );
+ jabber_buddy_add( ic, "bugtest@google.com/C" );
+ fail_unless( jabber_buddy_remove( ic, "bugtest@google.com/A" ) );
+ fail_unless( jabber_buddy_remove( ic, "bugtest@google.com/B" ) );
+ fail_unless( jabber_buddy_remove( ic, "bugtest@google.com/C" ) );
}
Suite *jabber_util_suite (void)
hotfix/0.9.0.4 Unnamed repository; edit this file 'description' to name the repository.MimesBrønn
aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gems/gettext-2.1.0/samples/po/pt_BR/hello_plural.po
blob: 01bb0b996f054ede66625d40090f2abb46a26a34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# hello_plural.po - sample for GetText.n_().
#
# Copyright (C) 2002-2006 Masao Mutoh
#
# Joao Pedrosa <joaopedrosa at gmail.com>, 2004, 2005.
#
msgid ""
msgstr ""
"Project-Id-Version: ruby-gettext 1.6.0\n"
"POT-Creation-Date: 2005-12-17 14:56+0900\n"
"PO-Revision-Date: 2005-12-17 10:12-0300\n"
"Last-Translator: Joao Pedrosa <joaopedrosa at gmail.com>\n"
"Language-Team: Portuguese(Brazil)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: hello_plural.rb:11
msgid "There is an apple.\n"
msgid_plural "There are %{num} apples.\n"
msgstr[0] "Existe uma maçã.\n"
msgstr[1] "Existem %{num} maçãs.\n"