From: Peter Verthez Date: Sat, 25 Jan 2003 19:22:00 +0000 (+0000) Subject: Make sure that a note record tag with an empty value is removed. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=c9244d0b6ce2dae9311dc5f6a49ee774b1d2f98a;p=gedcom-parse.git Make sure that a note record tag with an empty value is removed. --- diff --git a/gedcom/gedcom.y b/gedcom/gedcom.y index f03280f..f853e7d 100644 --- a/gedcom/gedcom.y +++ b/gedcom/gedcom.y @@ -2285,7 +2285,14 @@ cont_sect : OPEN DELIM TAG_CONT mand_line_item { $$ = start_element(ELT_SUB_CONT, PARENT, $1, $3, $4, GEDCOM_MAKE_STRING(val1, $4)); - SAFE_BUF_ADDCHAR(&concat_buffer, '\n'); + if (compat_mode(C_NOTE_NO_VALUE)) { + char* str = get_buf_string(&concat_buffer); + if (str[0] != '\0') + SAFE_BUF_ADDCHAR(&concat_buffer, '\n'); + } + else { + SAFE_BUF_ADDCHAR(&concat_buffer, '\n'); + } safe_buf_append(&concat_buffer, $4); START(CONT, $1, $$) }