]> granicus.if.org Git - graphviz/commitdiff
Fix bug in twopi where a node attribute "root" is not defined. This never
authorEmden R. Gansner <erg@emdenrg.net>
Sun, 14 Feb 2016 21:00:21 +0000 (16:00 -0500)
committerEmden R. Gansner <erg@emdenrg.net>
Sun, 14 Feb 2016 21:00:21 +0000 (16:00 -0500)
worked.

lib/twopigen/twopiinit.c

index ff9ea1165f67ffd8b94c562862a69e65183bc847..341d140856279f8c1dd6ce38a639375f60fcf4b5 100644 (file)
@@ -123,7 +123,7 @@ void twopi_layout(Agraph_t * g)
        if (ncc == 1) {
            if (ctr)
                lctr = ctr;
-           else if (!(lctr = findRootNode(g, rootattr)))
+           else if (!rootattr || !(lctr = findRootNode(g, rootattr)))
                lctr = 0;
            c = circleLayout(g, lctr);
            if (setRoot && !ctr)
@@ -144,7 +144,7 @@ void twopi_layout(Agraph_t * g)
                sg = ccs[i];
                if (ctr && agcontains(sg, ctr))
                    lctr = ctr;
-               else if (!(lctr = findRootNode(sg, rootattr)))
+               else if (!rootattr || !(lctr = findRootNode(sg, rootattr)))
                    lctr = 0;
                nodeInduce(sg);
                c = circleLayout(sg, lctr);