File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,18 @@ xml_print_ex(FILE * __restrict ostream,
28
28
int opt ) {
29
29
const xml_t * parent ;
30
30
const xml_attr_t * a ;
31
- int pad , i ;
31
+ int pad , i , snode ;
32
32
33
- pad = 0 ;
33
+ pad = snode = 0 ;
34
34
parent = NULL ;
35
35
36
36
while (xml ) {
37
- if (opt > 0 && xml -> type == XML_ELEMENT ) {
37
+ if (! snode && opt > 0 && xml -> type == XML_ELEMENT ) {
38
38
for (i = 0 ; i < pad ; i ++ )
39
39
fprintf (ostream , "\t" );
40
40
}
41
41
42
+ snode = 0 ;
42
43
switch (xml -> type ) {
43
44
case XML_ELEMENT : {
44
45
if (!xml -> prefix )
@@ -100,6 +101,7 @@ xml_print_ex(FILE * __restrict ostream,
100
101
}
101
102
case XML_STRING :
102
103
fprintf (ostream , "%.*s" , xml -> valsize , xml -> val );
104
+ snode = 1 ;
103
105
break ;
104
106
default :
105
107
break ;
@@ -108,6 +110,7 @@ xml_print_ex(FILE * __restrict ostream,
108
110
if (xml -> next ) {
109
111
xml = xml -> next ;
110
112
} else if ((parent = xml -> parent )) {
113
+ snode = 0 ;
111
114
do {
112
115
if (opt > 0 && (!xml || (xml && xml -> type == XML_ELEMENT ))) {
113
116
for (i = 0 ; i < pad ; i ++ )
You can’t perform that action at this time.
0 commit comments