Skip to content

Instantly share code, notes, and snippets.

@xiagu
Created April 26, 2016 21:26
Show Gist options
  • Save xiagu/fbb191a928945b84329aef6c2ccd6676 to your computer and use it in GitHub Desktop.
Save xiagu/fbb191a928945b84329aef6c2ccd6676 to your computer and use it in GitHub Desktop.
A snippet containing a small edge case bug.
index2 = (completion->direction < 0) ? index - 1 : index + 1;
while ((index2 >= 0) && (index2 < completion->list->size))
{
ptr_completion_word2 =
(struct t_gui_completion_word *)(completion->list->data[index2]);
if ((ptr_completion_word->nick_completion
&& (gui_completion_nickncmp (completion->base_word,
ptr_completion_word2->word,
length) == 0))
|| (!ptr_completion_word->nick_completion
&& (string_strncasecmp (completion->base_word,
ptr_completion_word2->word,
length) == 0)))
{
other_completion++;
}
index2 = (completion->direction < 0) ?
index2 - 1 : index2 + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment