aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term_tag.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-04-08 11:56:03 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-04-08 11:56:03 +0000
commit637b922ab2b2aa18419a0abed18ae9d2fed4e50a (patch)
tree43a6a061839c1d2a8278fd43533f585b09e81304 /term_tag.c
parentf4c07cc80595b2276a99fd6e5c95c734187feaab (diff)
downloadmandoc-637b922ab2b2aa18419a0abed18ae9d2fed4e50a.tar.gz
mandoc-637b922ab2b2aa18419a0abed18ae9d2fed4e50a.tar.zst
mandoc-637b922ab2b2aa18419a0abed18ae9d2fed4e50a.zip
Use a separate node->tag attribute rather than abusing the node->string
attribute for the purpose. No functional change intended. The purpose is to make it possible to later attach tags to text nodes.
Diffstat (limited to 'term_tag.c')
-rw-r--r--term_tag.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/term_tag.c b/term_tag.c
index f6203a6c..201471c5 100644
--- a/term_tag.c
+++ b/term_tag.c
@@ -1,4 +1,4 @@
-/* $Id: term_tag.c,v 1.2 2020/04/02 22:12:55 schwarze Exp $ */
+/* $Id: term_tag.c,v 1.3 2020/04/08 11:56:04 schwarze Exp $ */
/*
* Copyright (c) 2015,2016,2018,2019,2020 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -129,9 +129,7 @@ term_tag_write(struct roff_node *n, size_t line)
if (tag_files.tfs == NULL)
return;
- if (n->string == NULL)
- n = n->child;
- cp = n->string;
+ cp = n->tag == NULL ? n->child->string : n->tag;
if (cp[0] == '\\' && (cp[1] == '&' || cp[1] == 'e'))
cp += 2;
len = strcspn(cp, " \t\\");