=================================================================== RCS file: /cvs/mandoc/Attic/argv.c,v retrieving revision 1.53 retrieving revision 1.56 diff -u -p -r1.53 -r1.56 --- mandoc/Attic/argv.c 2009/03/16 23:37:28 1.53 +++ mandoc/Attic/argv.c 2009/03/23 14:22:11 1.56 @@ -1,4 +1,4 @@ -/* $Id: argv.c,v 1.53 2009/03/16 23:37:28 kristaps Exp $ */ +/* $Id: argv.c,v 1.56 2009/03/23 14:22:11 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -25,7 +25,7 @@ #include #include -#include "private.h" +#include "libmdoc.h" /* * Routines to parse arguments of macros. Arguments follow the syntax @@ -223,6 +223,7 @@ static int mdoc_argflags[MDOC_MAX] = { 0, /* Es */ 0, /* En */ 0, /* Dx */ + ARGS_QUOTED, /* %Q */ }; @@ -293,7 +294,8 @@ mdoc_argv(struct mdoc *mdoc, int line, int tok, return(ARGV_ERROR); if (NULL == (arg = *v)) { - *v = xcalloc(1, sizeof(struct mdoc_arg)); + if (NULL == (*v = calloc(1, sizeof(struct mdoc_arg)))) + err(1, "calloc"); arg = *v; } @@ -329,7 +331,7 @@ mdoc_argv_free(struct mdoc_arg *p) if (0 == p->argv[i].sz) continue; /* LINTED */ - for (j = 0; j < (int)p->argv[i].sz; j++) + for (j = 0; j < (int)p->argv[i].sz; j++) free(p->argv[i].value[j]); free(p->argv[i].value); @@ -791,8 +793,10 @@ argv_opt_single(struct mdoc *mdoc, int line, return(1); v->sz = 1; - v->value = xcalloc(1, sizeof(char *)); - v->value[0] = xstrdup(p); + if (NULL == (v->value = calloc(1, sizeof(char *)))) + err(1, "calloc"); + if (NULL == (v->value[0] = strdup(p))) + err(1, "strdup"); return(1); } @@ -816,8 +820,10 @@ argv_single(struct mdoc *mdoc, int line, return(perr(mdoc, line, ppos, EARGVAL)); v->sz = 1; - v->value = xcalloc(1, sizeof(char *)); - v->value[0] = xstrdup(p); + if (NULL == (v->value = calloc(1, sizeof(char *)))) + err(1, "calloc"); + if (NULL == (v->value[0] = strdup(p))) + err(1, "strdup"); return(1); }