=================================================================== RCS file: /cvs/mandoc/Attic/macro.c,v retrieving revision 1.53 retrieving revision 1.56 diff -u -p -r1.53 -r1.56 --- mandoc/Attic/macro.c 2009/02/26 14:56:27 1.53 +++ mandoc/Attic/macro.c 2009/03/05 12:08:53 1.56 @@ -1,4 +1,4 @@ -/* $Id: macro.c,v 1.53 2009/02/26 14:56:27 kristaps Exp $ */ +/* $Id: macro.c,v 1.56 2009/03/05 12:08:53 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -31,6 +31,11 @@ * macro. */ +/* + * FIXME: don't use static mdoc_argv values, as they require us to do a + * complicated copy-over when actually assigning them to dynamic memory. + */ + #include "private.h" static int macro_obsolete(MACRO_PROT_ARGS); @@ -750,7 +755,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); @@ -795,6 +801,8 @@ macro_text(MACRO_PROT_ARGS) return(0); } + /* FIXME: .Fl and .Ar handling of `|'. */ + if (ARGS_QWORD != w && mdoc_isdelim(p)) { if (0 == lastpunct && ! rewind_elem(mdoc, tok)) { mdoc_argv_free(argc, argv); @@ -802,8 +810,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); @@ -1225,7 +1233,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) @@ -1316,7 +1326,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)