summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xml2tsv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xml2tsv.c b/xml2tsv.c
index 27984bc..aea5751 100644
--- a/xml2tsv.c
+++ b/xml2tsv.c
@@ -176,8 +176,8 @@ xmlcdata(XMLParser *x, const char *d, size_t dl)
void
xmldata(XMLParser *x, const char *d, size_t dl)
{
- if (stack_peek(&st) || (strcspn(d, " \t\n") && emitsep)){
- putchar(SEP);
+ if ((strcspn(d, " \t\n") || (strspn(d, " \t\n")<strlen(d) && !stack_peek(&st)->ref)) && emitsep){
+ putchar(SEP);
emitsep = FALSE;
}
quote_print(d);