keys.c (Key_Message): move backspace handling before non-printable

check. (the functionality doesn't change. from tyrquake git repo.)
minor tidy-up.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@843 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2013-04-02 21:40:48 +00:00
parent 00e44d6227
commit e0f9f533f3

View file

@ -508,20 +508,17 @@ void Key_Message (int key)
return;
}
if (key < 32 || key > 127)
return; // non printable
if (key == K_BACKSPACE)
{
if (chat_bufferlen)
{
chat_bufferlen--;
chat_buffer[chat_bufferlen] = 0;
}
chat_buffer[--chat_bufferlen] = 0;
return;
}
if (chat_bufferlen == sizeof(chat_buffer)-1)
if (key < 32 || key > 127)
return; // non printable
if (chat_bufferlen == sizeof(chat_buffer) - 1)
return; // all full
chat_buffer[chat_bufferlen++] = key;