From: Emden Gansner Date: Fri, 10 Feb 2017 20:13:17 +0000 (-0500) Subject: Fix issue #1207 - if an edge key is written as part of printing all attributes, it... X-Git-Tag: 2.42.0~212 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=617fd44569ba4b1cabcaded036b19db9028c12b1;p=graphviz Fix issue #1207 - if an edge key is written as part of printing all attributes, it must increase the tab level. --- diff --git a/lib/cgraph/write.c b/lib/cgraph/write.c index 6fe2e6df6..e860849b1 100644 --- a/lib/cgraph/write.c +++ b/lib/cgraph/write.c @@ -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"));