]> granicus.if.org Git - graphviz/commitdiff
Fix issue #1207 - if an edge key is written as part of printing all attributes, it...
authorEmden Gansner <emdenrg@google.com>
Fri, 10 Feb 2017 20:13:17 +0000 (15:13 -0500)
committerEmden Gansner <emdenrg@google.com>
Fri, 10 Feb 2017 20:13:17 +0000 (15:13 -0500)
lib/cgraph/write.c

index 6fe2e6df6401c2c951034ae95483c00167a8c206..e860849b1c038a9e2d3e67ca7192ce4852b4d533 100644 (file)
@@ -451,7 +451,10 @@ static int write_edge_name(Agedge_t * e, iochan_t * ofile, int terminate)
     p = agnameof(e);
     g = agraphof(e);
     if (NOT(EMPTY(p))) {
-       CHKRV(ioput(g, ofile, " [key="));
+       if (!terminate) {
+           Level++;
+       }
+       CHKRV(ioput(g, ofile, "\t[key="));
        CHKRV(write_canonstr(g, ofile, p));
        if (terminate)
            CHKRV(ioput(g, ofile, "]"));
@@ -489,8 +492,7 @@ static int write_nondefault_attrs(void *obj, iochan_t * ofile,
            }
            if (data->str[sym->id] != sym->defval) {
                if (cnt++ == 0) {
-                   CHKRV(indent(g, ofile));
-                   CHKRV(ioput(g, ofile, " ["));
+                   CHKRV(ioput(g, ofile, "\t["));
                    Level++;
                } else {
                    CHKRV(ioput(g, ofile, ",\n"));