forked from enlightenment/edi
debugpanel: fix debug process.
Reviewers: ajwillia.ms Reviewed By: ajwillia.ms Subscribers: bu5hm4n Differential Revision: https://phab.enlightenment.org/D4987
This commit is contained in:
parent
849619d32b
commit
4c4ec6e21b
|
@ -52,24 +52,28 @@ static Eina_Bool
|
||||||
_debugpanel_stdout_handler(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
_debugpanel_stdout_handler(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Exe_Event_Data *ev;
|
Ecore_Exe_Event_Data *ev;
|
||||||
char buf[65535];
|
int idx;
|
||||||
char *pos, *start, *end = NULL;
|
char *start, *end = NULL;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev)
|
|
||||||
{
|
|
||||||
if (ev->size >= (int)(sizeof(buf) -2)) return ECORE_CALLBACK_DONE;
|
|
||||||
|
|
||||||
|
if (ev && ev->size)
|
||||||
|
{
|
||||||
|
if (!ev->data) return ECORE_CALLBACK_DONE;
|
||||||
|
|
||||||
|
char buf[ev->size + 1];
|
||||||
memcpy(buf, ev->data, ev->size);
|
memcpy(buf, ev->data, ev->size);
|
||||||
buf[ev->size] = 0;
|
buf[ev->size] = '\0';
|
||||||
|
|
||||||
pos = buf;
|
idx = 0;
|
||||||
start = pos;
|
|
||||||
if (*start == '\n') start++;
|
if (buf[idx] == '\n')
|
||||||
while (*pos++ != '\0')
|
idx++;
|
||||||
|
|
||||||
|
start = &buf[idx];
|
||||||
|
while (idx < ev->size)
|
||||||
{
|
{
|
||||||
if (*pos == '\n')
|
if (buf[idx] == '\n')
|
||||||
end = pos;
|
end = &buf[idx];
|
||||||
|
|
||||||
if (start && end)
|
if (start && end)
|
||||||
{
|
{
|
||||||
|
@ -77,6 +81,7 @@ _debugpanel_stdout_handler(void *data EINA_UNUSED, int type EINA_UNUSED, void *e
|
||||||
start = end + 1;
|
start = end + 1;
|
||||||
end = NULL;
|
end = NULL;
|
||||||
}
|
}
|
||||||
|
idx++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue