From 792b9c4c5a44280611945547a57ac9e48af5baf1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 14 Apr 2022 16:43:43 +0000 Subject: support for hunting memory leaks; designed and written last autumn, polished today --- mdoc_macro.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mdoc_macro.c') diff --git a/mdoc_macro.c b/mdoc_macro.c index dd3885c7..889b80a6 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,7 +1,7 @@ -/* $Id: mdoc_macro.c,v 1.234 2020/01/19 18:02:00 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.235 2022/04/14 16:43:44 schwarze Exp $ */ /* + * Copyright (c) 2010, 2012-2021 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons - * Copyright (c) 2010, 2012-2020 Ingo Schwarze * * 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 #include +#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, -- cgit v1.2.3