From 625609c79b9bdee1f1f55d0de7b705f66ac7050a Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 2 Oct 2024 03:00:01 -0400 Subject: [PATCH] man/parse: proper structure checks for LINE_TP and LINE_PP --- src/man/parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/man/parse.c b/src/man/parse.c index fd3f1de69e..e58a4b4213 100644 --- a/src/man/parse.c +++ b/src/man/parse.c @@ -327,7 +327,7 @@ int troff_parse(const unsigned char* map, size_t mlen, pagedom* dom){ current_subsection->ttype = node; current_para = current_subsection; }else if(node->ltype == LINE_PP){ - if(dom->root == NULL){ + if(current_para == NULL){ fprintf(stderr, "paragraph transcends structure\n"); return -1; } @@ -336,7 +336,7 @@ int troff_parse(const unsigned char* map, size_t mlen, pagedom* dom){ } current_para->ttype = node; }else if(node->ltype == LINE_TP){ - if(dom->root == NULL){ + if(current_para == NULL){ fprintf(stderr, "tagged paragraph transcends structure\n"); return -1; }