summaryrefslogtreecommitdiffstats
path: root/mdoc_argv.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-09-24 13:03:32 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-09-24 13:03:32 +0000
commit81c9a3f1c3d4a64b4404c010ceda364c2afd9e7c (patch)
tree3a29277c304a82861246c998d6b623a5a624e7f5 /mdoc_argv.c
parent0371d94639d271317d0697e7eefe5cb79df85fb7 (diff)
downloadmandoc-81c9a3f1c3d4a64b4404c010ceda364c2afd9e7c.tar.gz
-offset string can now be blank (supplied with 6n as stipulated by mdoc.samples).
Diffstat (limited to 'mdoc_argv.c')
-rw-r--r--mdoc_argv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 20a9dc5e..e0919c7a 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -60,7 +60,7 @@ static int mdoc_argvflags[MDOC_ARG_MAX] = {
ARGV_NONE, /* MDOC_Unfilled */
ARGV_NONE, /* MDOC_Literal */
ARGV_NONE, /* MDOC_File */
- ARGV_SINGLE, /* MDOC_Offset */
+ ARGV_OPT_SINGLE, /* MDOC_Offset */
ARGV_NONE, /* MDOC_Bullet */
ARGV_NONE, /* MDOC_Dash */
ARGV_NONE, /* MDOC_Hyphen */
@@ -309,9 +309,13 @@ mdoc_argv_free(struct mdoc_arg *p)
for (i = 0; i < (int)p->argc; i++) {
if (0 == p->argv[i].sz)
continue;
+ if (NULL == p->argv[i].value)
+ continue;
+
/* LINTED */
for (j = 0; j < (int)p->argv[i].sz; j++)
- free(p->argv[i].value[j]);
+ if (p->argv[i].value[j])
+ free(p->argv[i].value[j]);
free(p->argv[i].value);
}