From 6ad9d377c0eb9e4b505e75fbfe5ccc2dec7790dc Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 15 Oct 2008 22:56:06 +0000 Subject: [PATCH] Fix bug in isEdge function which was always checking in the root graph --- cmd/gvpr/actions.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; -- 2.40.0