summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-03-13 12:41:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-03-13 12:41:56 +0200
commitad1a0d713e1bc10022c170d3b1b8648d4182edac (patch)
tree9b47f02091ca25ff2d83125c9910dc1bf85c8910
parentbf6b63d2a72d37bee0248e5a2c39d933454d617a (diff)
Fix indentation issue with immediately-closed tags
-rw-r--r--genx.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/genx.c b/genx.c
index dfee0df..d69208f 100644
--- a/genx.c
+++ b/genx.c
@@ -1294,8 +1294,11 @@ static genxStatus writeStartTag(genxWriter w, Boolean close)
if (writeIndentation (w) != GENX_SUCCESS)
return w->status;
- w->ppDepth++;
- w->ppSimple = True;
+ if (!close)
+ {
+ w->ppDepth++;
+ w->ppSimple = True;
+ }
}
SendCheck(w, "<");
@@ -1785,8 +1788,6 @@ genxStatus genxEndElement(genxWriter w)
if (!w->ppSimple)
if (writeIndentation (w) != GENX_SUCCESS)
return w->status;
-
- w->ppSimple = False;
}
SendCheck(w, "</");
@@ -1799,6 +1800,9 @@ genxStatus genxEndElement(genxWriter w)
SendCheck(w, ">");
}
+ if (w->ppIndent)
+ w->ppSimple = False;
+
/*
* pop zero or more namespace declarations, then a null, then the
* start-element declaration off the stack