-int Nicks_CompleteChatLine(char *buffer, size_t size, unsigned int pos)
-{
- int n;
- /*if(!con_nickcompletion.integer)
- return; is tested in Nicks_CompletionCountPossible */
- n = Nicks_CompleteCountPossible(buffer, pos, &buffer[pos], false);
- if(n == 1)
- {
- size_t len;
- char *msg;
-
- msg = Nicks_list[0];
- len = min(size - Nicks_matchpos - 3, strlen(msg));
- memcpy(&buffer[Nicks_matchpos], msg, len);
- if( len < (size - 7) ) // space for color (^[0-9] or ^xrgb) and space and \0
- len = (int)Nicks_AddLastColor(buffer, Nicks_matchpos+(int)len);
- buffer[len++] = ' ';
- buffer[len] = 0;
- return (int)len;
- } else if(n > 1)
- {
- int len;
- char *msg;
- Con_Printf("\n%i possible nicks:\n", n);
- Cmd_CompleteNicksPrint(n);
-
- Nicks_CutMatches(n);
-
- msg = Nicks_sanlist[0];
- len = (int)min(size - Nicks_matchpos, strlen(msg));
- memcpy(&buffer[Nicks_matchpos], msg, len);
- buffer[Nicks_matchpos + len] = 0;
- //pos += len;
- return Nicks_matchpos + len;
- }
- return pos;
-}
-
-