X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/972a8d7ae7f6cd2ac8f3987e69555ad859c46dac..c5cc67f801d437ed8601ac67e37ccdc77f0cac0b:/mdoc_argv.c?ds=inline diff --git a/mdoc_argv.c b/mdoc_argv.c index 700d558a..453d1146 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -1,6 +1,6 @@ -/* $Id: mdoc_argv.c,v 1.54 2010/06/19 20:46:28 kristaps Exp $ */ +/* $Id: mdoc_argv.c,v 1.58 2010/07/21 09:36:41 kristaps Exp $ */ /* - * Copyright (c) 2008, 2009 Kristaps Dzonsons + * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -45,7 +45,7 @@ #define MULTI_STEP 5 -static int argv_a2arg(enum mdoct, const char *); +static enum mdocargt argv_a2arg(enum mdoct, const char *); static enum margserr args(struct mdoc *, int, int *, char *, int, char **); static int argv(struct mdoc *, int, @@ -313,9 +313,11 @@ mdoc_argv_free(struct mdoc_arg *p) void mdoc_argn_free(struct mdoc_arg *p, int iarg) { - struct mdoc_argv *arg = &p->argv[iarg]; + struct mdoc_argv *arg; int j; + arg = &p->argv[iarg]; + if (arg->sz && arg->value) { for (j = (int)arg->sz - 1; j >= 0; j--) free(arg->value[j]); @@ -359,7 +361,8 @@ mdoc_args(struct mdoc *m, int line, int *pos, if (MDOC_Bl == n->tok) break; - if (n && LIST_column == n->data.Bl.type) { + assert(n->data.Bl); + if (n && LIST_column == n->data.Bl->type) { fl |= ARGS_TABSEP; fl &= ~ARGS_DELIM; } @@ -582,7 +585,7 @@ args(struct mdoc *m, int line, int *pos, } -static int +static enum mdocargt argv_a2arg(enum mdoct tok, const char *p) {