fix the condition to emit SEP in xmldata - xml2tsv - a simple xml-to-tsv converter, based on xmlparser
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit e45f9c38cbcc4c544f0107d1abc79f4e1e039413
(DIR) parent df38d2270241927e5436a0bc36ffb99044a8f4fb
(HTM) Author: KatolaZ <katolaz@freaknet.org>
Date: Wed, 8 Dec 2021 22:24:31 +0000
fix the condition to emit SEP in xmldata
Diffstat:
M xml2tsv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git 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);