summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xC.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xC.c b/xC.c
index ecb3c2d..2027a6a 100644
--- a/xC.c
+++ b/xC.c
@@ -13581,16 +13581,17 @@ static void
complete_nicknames (struct buffer *buffer, struct completion *data,
const char *word, struct strv *output)
{
+ size_t word_len = strlen (word);
if (buffer->type == BUFFER_SERVER)
{
struct user *self_user = buffer->server->irc_user;
- if (self_user)
+ if (self_user && !irc_server_strncmp (buffer->server,
+ word, self_user->nickname, word_len))
strv_append (output, self_user->nickname);
}
if (buffer->type != BUFFER_CHANNEL)
return;
- size_t word_len = strlen (word);
LIST_FOR_EACH (struct channel_user, iter, buffer->channel->users)
{
const char *nickname = iter->user->nickname;