From: erg Date: Fri, 4 Sep 2009 02:44:21 +0000 (+0000) Subject: Fix holes in code for writing when using libcgraph X-Git-Tag: LAST_LIBGRAPH~32^2~1724 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87f53ee14301ca216311de512ba88688a3727ca0;p=graphviz Fix holes in code for writing when using libcgraph --- 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 }