GVPR fails to restore IO discipline
lib/gvpr/actions.c contains the following:
/* sfioWrite:
* If the graph is passed in from a library, its output discipline
* might not use sfio. In this case, we push an sfio discipline on
* the graph, write it, and then pop it off.
*/
int sfioWrite(Agraph_t * g, Sfio_t* fp, Agiodisc_t* dfltDisc)
{
Agiodisc_t* saveio = NULL;
int rv;
if (g->clos->disc.io != dfltDisc) {
saveio = g->clos->disc.io;
g->clos->disc.io = dfltDisc;
}
rv = agwrite (g, fp);
if (g->clos->disc.io != dfltDisc) {
g->clos->disc.io = saveio;
}
return rv;
}
Note how the second branch here is attempting to restore the original IO discipline. But g->clos->disc.io
has already been overwritten by the first branch. So the condition in the second branch is always false.