mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix unicode pasting in DoEditBox
This commit is contained in:
parent
a3a363f665
commit
44c699b812
|
@ -249,12 +249,16 @@ int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrS
|
|||
{
|
||||
int Offset = str_length(pStr);
|
||||
int CharsLeft = StrSize - Offset - 1;
|
||||
for(int i = 0; i < str_length(Text) && i < CharsLeft; i++)
|
||||
char *pCur = pStr + Offset;
|
||||
str_utf8_copy(pCur, Text, CharsLeft);
|
||||
for(int i = 0; i < CharsLeft; i++)
|
||||
{
|
||||
if(Text[i] == '\n')
|
||||
pStr[i + Offset] = ' ';
|
||||
else
|
||||
pStr[i + Offset] = Text[i];
|
||||
if(pCur[i] == 0)
|
||||
break;
|
||||
else if(pCur[i] == '\r')
|
||||
pCur[i] = ' ';
|
||||
else if(pCur[i] == '\n')
|
||||
pCur[i] = ' ';
|
||||
}
|
||||
s_AtIndex = str_length(pStr);
|
||||
ReturnValue = true;
|
||||
|
|
Loading…
Reference in a new issue