Pārlūkot izejas kodu

* Re-add the cx->torender trick to avoid crashing on filters. This really

needs some architecture thinking.
pull/1/head
Sam Hocevar sam pirms 16 gadiem
vecāks
revīzija
71ab147f05
2 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. +4
    -1
      src/figlet.c
  2. +2
    -1
      src/render.c

+ 4
- 1
src/figlet.c Parādīt failu

@@ -59,7 +59,10 @@ static int feed_figlet(context_t *cx, uint32_t ch, uint32_t attr)

static int flush_figlet(context_t *cx)
{
return cucul_flush_figlet(cx->cv);
int ret = cucul_flush_figlet(cx->cv);
cx->torender = cx->cv;
cx->cv = cucul_create_canvas(0, 0);
return ret;
}

static int end_figlet(context_t *cx)


+ 2
- 1
src/render.c Parādīt failu

@@ -156,11 +156,12 @@ static int render_flush(context_t *cx)
filter_do(cx);

/* Output line */
buffer = cucul_export_memory(cx->cv, cx->export, &len);
buffer = cucul_export_memory(cx->torender, cx->export, &len);
if(!buffer)
return -1;
fwrite(buffer, len, 1, stdout);
free(buffer);
cucul_free_canvas(cx->torender);

return 0;
}


Notiek ielāde…
Atcelt
Saglabāt