]> granicus.if.org Git - graphviz/commitdiff
Fix bug in isEdge function which was always checking in the root graph
authorerg <devnull@localhost>
Wed, 15 Oct 2008 22:56:06 +0000 (22:56 +0000)
committererg <devnull@localhost>
Wed, 15 Oct 2008 22:56:06 +0000 (22:56 +0000)
cmd/gvpr/actions.c

index 788c25b2aaef9a469d2b30c27c1fb8309902fca3..a40bc8469918bc3ccaffb2e657b073f1389e93cf 100644 (file)
@@ -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;