]> granicus.if.org Git - graphviz/commitdiff
fixed bug in handling self-edges in agnxtedge()
authornorth <devnull@localhost>
Wed, 11 Mar 2009 01:00:24 +0000 (01:00 +0000)
committernorth <devnull@localhost>
Wed, 11 Mar 2009 01:00:24 +0000 (01:00 +0000)
lib/cgraph/edge.c

index 98e45f1a5757c9a0cebf61c0d20dd46efabcc134..5510cb6bad63c614020e830ef1dc2b62226c4180 100644 (file)
@@ -91,12 +91,12 @@ Agedge_t *agnxtedge(Agraph_t * g, Agedge_t * e, Agnode_t * n)
 {
     Agedge_t *rv;
 
-    if (n == AGTAIL(e)) {
-       rv = agnxtout(g, e);
-       if (rv == NILedge)
-           rv = agfstin(g, n);
+       if (AGTYPE(e) == AGOUTEDGE) {
+               rv = agnxtout(g, e);
+               if (rv == NILedge)
+                       rv = agfstin(g, n);
     } else
-       rv = agnxtin(g, e);
+               rv = agnxtin(g, e);
     return rv;
 }