]> granicus.if.org Git - graphviz/commitdiff
Fix bug 1145
authorerg <devnull@localhost>
Mon, 18 Jun 2007 22:45:11 +0000 (22:45 +0000)
committererg <devnull@localhost>
Mon, 18 Jun 2007 22:45:11 +0000 (22:45 +0000)
lib/common/utils.c

index cc9fba532959b6094ed604b71eddc57a6aa82e70..bf0d3e81ee93a008ed7e07947f40465fa6e92476 100644 (file)
@@ -1073,6 +1073,7 @@ checkCompound(edge_t * e, graph_t * clg, agxbuf * xb, Dt_t * map)
     edge_t *ce;
     item *ip;
 
+    if (IS_CLUST_NODE(h)) return;
     tg = MAPC(t);
     hg = MAPC(h);
     if (!tg && !hg)
@@ -1136,6 +1137,7 @@ int processClusterEdges(graph_t * g)
 {
     int rv;
     node_t *n;
+    node_t *nxt;
     edge_t *e;
     graph_t *clg;
     agxbuf xb;
@@ -1146,6 +1148,7 @@ int processClusterEdges(graph_t * g)
     clg = agsubg(g, "__clusternodes");
     agxbinit(&xb, SMALLBUF, buf);
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
+       if (IS_CLUST_NODE(n)) continue;
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
            checkCompound(e, clg, &xb, map);
        }
@@ -1153,7 +1156,8 @@ int processClusterEdges(graph_t * g)
     agxbfree(&xb);
     dtclose(map);
     rv = agnnodes(clg);
-    for (n = agfstnode(clg); n; n = agnxtnode(clg, n)) {
+    for (n = agfstnode(clg); n; n = nxt) {
+       nxt = agnxtnode(clg, n);
        agdelete(g, n);
     }
     agclose(clg);