From: erg Date: Wed, 15 Oct 2008 22:56:06 +0000 (+0000) Subject: Fix bug in isEdge function which was always checking in the root graph X-Git-Tag: LAST_LIBGRAPH~32^2~3098 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ad9d377c0eb9e4b505e75fbfe5ccc2dec7790dc;p=graphviz Fix bug in isEdge function which was always checking in the root graph --- diff --git a/cmd/gvpr/actions.c b/cmd/gvpr/actions.c index 788c25b2a..a40bc8469 100644 --- a/cmd/gvpr/actions.c +++ b/cmd/gvpr/actions.c @@ -365,7 +365,7 @@ Agraph_t *compOf(Agraph_t * g, Agnode_t * n) /* isEdge: * Return edge, if any, between t and h with given key. - * Edge is in root graph + * Edge is in g. */ Agedge_t *isEdge(Agraph_t* g, Agnode_t * t, Agnode_t * h, char *key) { @@ -374,8 +374,9 @@ Agedge_t *isEdge(Agraph_t* g, Agnode_t * t, Agnode_t * h, char *key) root = sameG(t, h, "isEdge", "tail and head node"); if (!root) return 0; - if (g && (root != agroot(g))) - return 0; + if (g) { + if (root != agroot(g)) return 0; + } else g = root;