domfs

Document Object Model as a filesystem for plan9 os
git clone git://nsmpr.xyz/domfs.git
Log | Files | Refs | README

commit 347c1d43687915332ecf34a85a7cb2a00f572f5f
parent 420bfdf81f0dfedc8d07a87bae5091b888952d67
Author: Pavel Renev <an2qzavok@gmail.com>
Date:   Sun, 31 Jan 2021 15:35:57 +0000

html5dom: check if element is self-closing

Diffstat:
Mtree.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tree.c b/tree.c @@ -135,10 +135,12 @@ threadtreeconstr(void *v) nwrite(strnode, "name", s_to_c(tok->name), strlen(s_to_c(tok->name))); adopt(pnode, strnode); - tp = pnode; - pnode = strdup(strnode); - free(tp); - free(strnode); + if ((tok->flags & TF_SELF_CLOSING) == 0) { + tp = pnode; + pnode = strdup(strnode); + free(tp); + free(strnode); + } break; case TEND: if (tnode != nil) {