X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/41abdca0a25e1aa6d4a90432abb97b1f5d036ddf..3cd681acae540f380510bee14cd2ef802fbf4706:/macro.c diff --git a/macro.c b/macro.c index b72b2fc5..673eec30 100644 --- a/macro.c +++ b/macro.c @@ -1,4 +1,4 @@ -/* $Id: macro.c,v 1.52 2009/02/24 16:16:45 kristaps Exp $ */ +/* $Id: macro.c,v 1.54 2009/02/27 09:39:40 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -750,7 +750,8 @@ macro_text(MACRO_PROT_ARGS) return(perr(mdoc, line, ppos, EARGVLIM)); } - c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); + c = mdoc_elem_alloc(mdoc, line, ppos, + tok, (size_t)argc, argv); if (0 == c) { mdoc_argv_free(argc, argv); @@ -802,8 +803,8 @@ macro_text(MACRO_PROT_ARGS) } lastpunct = 1; } else if (lastpunct) { - c = mdoc_elem_alloc(mdoc, line, - ppos, tok, argc, argv); + c = mdoc_elem_alloc(mdoc, line, ppos, + tok, (size_t)argc, argv); if (0 == c) { mdoc_argv_free(argc, argv); return(0); @@ -921,11 +922,8 @@ macro_scoped(MACRO_PROT_ARGS) if (ARGS_ERROR == c) return(0); - if (ARGS_PUNCT == c) - break; if (ARGS_EOLN == c) break; - if (ARGS_PHRASE == c) { /* if ( ! mdoc_phrase(mdoc, line, lastarg, buf)) @@ -952,10 +950,10 @@ macro_scoped(MACRO_PROT_ARGS) break; } - if ( ! rewind_subblock(MDOC_HEAD, mdoc, tok, line, ppos)) - return(0); if (1 == ppos && ! append_delims(mdoc, line, pos, buf)) return(0); + if ( ! rewind_subblock(MDOC_HEAD, mdoc, tok, line, ppos)) + return(0); if ( ! mdoc_body_alloc(mdoc, line, ppos, tok)) return(0); @@ -1228,7 +1226,9 @@ macro_constant_delimited(MACRO_PROT_ARGS) return(perr(mdoc, line, ppos, EARGVLIM)); } - c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); + c = mdoc_elem_alloc(mdoc, line, ppos, + tok, (size_t)argc, argv); + mdoc_argv_free(argc, argv); if (0 == c) @@ -1319,7 +1319,9 @@ macro_constant(MACRO_PROT_ARGS) return(perr(mdoc, line, ppos, EARGVLIM)); } - c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); + c = mdoc_elem_alloc(mdoc, line, ppos, + tok, (size_t)argc, argv); + mdoc_argv_free(argc, argv); if (0 == c)