summaryrefslogtreecommitdiffstats
path: root/man_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-04-14 16:43:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-04-14 16:43:43 +0000
commitbddcaddd71aa306d9c5a606bc7ece6e2812925c5 (patch)
treecacfd28f1b6b5861bfa32dfeb9551fabcb76bf3c /man_macro.c
parent525559c24a4e02693f443d611b8920564a497f85 (diff)
downloadmandoc-bddcaddd71aa306d9c5a606bc7ece6e2812925c5.tar.gz
support for hunting memory leaks;
designed and written last autumn, polished today
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/man_macro.c b/man_macro.c
index e16a6a74..9157ee65 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -26,6 +26,9 @@
#include <stdlib.h>
#include <string.h>
+#if DEBUG_MEMORY
+#include "mandoc_dbg.h"
+#endif
#include "mandoc.h"
#include "roff.h"
#include "man.h"
@@ -394,6 +397,11 @@ in_line_eoln(MACRO_PROT_ARGS)
else if (tok == MAN_EE)
man->flags &= ~ROFF_NOFILL;
+#if DEBUG_MEMORY
+ if (tok == MAN_TH)
+ mandoc_dbg_name(buf);
+#endif
+
for (;;) {
if (buf[*pos] != '\0' && man->last != n && tok == MAN_PD) {
mandoc_msg(MANDOCERR_ARG_EXCESS, line, *pos,