restore terminology escapes.
This commit is contained in:
parent
ffd8f82a52
commit
7d90f43fff
|
@ -971,21 +971,22 @@ _handle_esc_terminology(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *
|
||||||
cc++;
|
cc++;
|
||||||
}
|
}
|
||||||
buf = bufsmall;
|
buf = bufsmall;
|
||||||
if (blen > (int)(sizeof(bufsmall) / sizeof(Eina_Unicode) - 10)) buf = malloc(blen * sizeof(Eina_Unicode) + 10);
|
if (blen > (int)((sizeof(bufsmall) / sizeof(Eina_Unicode)) - 40))
|
||||||
|
buf = malloc((blen * sizeof(Eina_Unicode)) + 40);
|
||||||
cc = (Eina_Unicode *)c;
|
cc = (Eina_Unicode *)c;
|
||||||
b = buf;
|
b = buf;
|
||||||
be = buf + blen;
|
be = buf + blen + 1;
|
||||||
while ((b < be) && (cc < ce) && (*cc != 0x0))
|
while ((cc < ce) && (*cc != 0x0))
|
||||||
{
|
{
|
||||||
*b = *cc;
|
*b = *cc;
|
||||||
b++;
|
b++;
|
||||||
cc++;
|
cc++;
|
||||||
}
|
}
|
||||||
if ((b < be) && (cc < ce) && (*cc == 0x0)) cc++;
|
if ((cc < ce) && (*cc == 0x0)) cc++;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (buf != bufsmall) free(buf);
|
if (buf != bufsmall) free(buf);
|
||||||
return cc - c;
|
return 0;
|
||||||
}
|
}
|
||||||
*b = 0;
|
*b = 0;
|
||||||
// commands are stored in the buffer, 0 bytes not allowd (end marker)
|
// commands are stored in the buffer, 0 bytes not allowd (end marker)
|
||||||
|
|
Loading…
Reference in New Issue