Merge branch 'terminology-1.4'
This commit is contained in:
commit
daa4f1bae0
|
@ -1029,18 +1029,17 @@ _getsel_cb(void *data,
|
||||||
|
|
||||||
if (ev->len <= 0) return EINA_TRUE;
|
if (ev->len <= 0) return EINA_TRUE;
|
||||||
|
|
||||||
buf = malloc(ev->len);
|
buf = calloc(2, ev->len); /* twice in case the paste is only \n */
|
||||||
if (buf)
|
if (buf)
|
||||||
{
|
{
|
||||||
char *s = ev->data;
|
const char *s = ev->data;
|
||||||
int i, j, pos = 0, prev_i;
|
int i, j, pos = 0;
|
||||||
|
|
||||||
/* apparently we have to convert \n into \r in terminal land. */
|
/* apparently we have to convert \n into \r in terminal land. */
|
||||||
for (i = 0; i < (int)ev->len && s[i];)
|
for (i = 0; i < (int)ev->len && s[i];)
|
||||||
{
|
{
|
||||||
Eina_Unicode g = 0;
|
Eina_Unicode g = 0;
|
||||||
|
int prev_i = i;
|
||||||
prev_i = i;
|
|
||||||
g = eina_unicode_utf8_next_get(s, &i);
|
g = eina_unicode_utf8_next_get(s, &i);
|
||||||
/* Skip escape codes as a security measure */
|
/* Skip escape codes as a security measure */
|
||||||
if ((g < '\n') ||
|
if ((g < '\n') ||
|
||||||
|
@ -1065,7 +1064,6 @@ _getsel_cb(void *data,
|
||||||
termpty_write(sd->pty, "\x1b[201~",
|
termpty_write(sd->pty, "\x1b[201~",
|
||||||
sizeof("\x1b[201~") - 1);
|
sizeof("\x1b[201~") - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue