diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2022-04-14 16:43:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2022-04-14 16:43:43 +0000 |
commit | bddcaddd71aa306d9c5a606bc7ece6e2812925c5 (patch) | |
tree | cacfd28f1b6b5861bfa32dfeb9551fabcb76bf3c /mdoc_macro.c | |
parent | 525559c24a4e02693f443d611b8920564a497f85 (diff) | |
download | mandoc-bddcaddd71aa306d9c5a606bc7ece6e2812925c5.tar.gz |
support for hunting memory leaks;
designed and written last autumn, polished today
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r-- | mdoc_macro.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c index 9294d846..ebc058f6 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,7 +1,7 @@ -/* $Id$ */ +/* $Id$ */ /* + * Copyright (c) 2010, 2012-2021 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> - * Copyright (c) 2010, 2012-2020 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -26,6 +26,9 @@ #include <string.h> #include <time.h> +#if DEBUG_MEMORY +#include "mandoc_dbg.h" +#endif #include "mandoc.h" #include "roff.h" #include "mdoc.h" @@ -1511,6 +1514,11 @@ in_line_eoln(MACRO_PROT_ARGS) rew_last(mdoc, n->parent); } +#if DEBUG_MEMORY + if (tok == MDOC_Dt) + mandoc_dbg_name(buf); +#endif + if (buf[*pos] == '\0' && (tok == MDOC_Fd || *roff_name[tok] == '%')) { mandoc_msg(MANDOCERR_MACRO_EMPTY, |