From 87f53ee14301ca216311de512ba88688a3727ca0 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 4 Sep 2009 02:44:21 +0000 Subject: [PATCH] Fix holes in code for writing when using libcgraph --- plugin/core/gvrender_core_dot.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugin/core/gvrender_core_dot.c b/plugin/core/gvrender_core_dot.c index e1294b9f1..353d44af3 100644 --- a/plugin/core/gvrender_core_dot.c +++ b/plugin/core/gvrender_core_dot.c @@ -413,11 +413,22 @@ static void xdot_end_graph(graph_t* g) static void dot_end_graph(GVJ_t *job) { graph_t *g = job->obj->u.g; +#ifdef WITH_CGRAPH + Agiodisc_t* io_save; + static Agiodisc_t io; + + if (io.afread == NULL) { + io.afread = AgIoDisc.afread; + io.putstr = gvputs; + io.flush = gvflush; + } +#endif #ifndef WITH_CGRAPH agsetiodisc(NULL, gvfwrite, gvferror); #else - // FIXME + io_save = g->clos->disc.io; + g->clos->disc.io = &io; #endif switch (job->render.id) { case FORMAT_PLAIN: @@ -440,7 +451,7 @@ static void dot_end_graph(GVJ_t *job) #ifndef WITH_CGRAPH agsetiodisc(NULL, NULL, NULL); #else - // FIXME + g->clos->disc.io = io_save; #endif } -- 2.40.0