summaryrefslogtreecommitdiffstatshomepage
path: root/man_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-26 11:16:21 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-26 11:16:21 +0000
commit7a53781f31374425f91901919904a537c832a699 (patch)
treeaf7de31c08d32a63b7059ddadfcf245ac67c0b5a /man_macro.c
parent48c75ac0d363231aad256b8377a73bc1f8d158d5 (diff)
downloadmandoc-7a53781f31374425f91901919904a537c832a699.tar.gz
mandoc-7a53781f31374425f91901919904a537c832a699.tar.zst
mandoc-7a53781f31374425f91901919904a537c832a699.zip
Fixed inheritence of initial macro into man_macro.
Removed warnxs from man_macro (man_vwarn).
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/man_macro.c b/man_macro.c
index 7121e490..70b3a912 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,4 +1,4 @@
-/* $Id: man_macro.c,v 1.7 2009/03/25 16:07:36 kristaps Exp $ */
+/* $Id: man_macro.c,v 1.8 2009/03/26 11:16:21 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
@@ -18,7 +18,6 @@
*/
#include <assert.h>
#include <ctype.h>
-#include <err.h> /* XXX */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -113,7 +112,7 @@ man_macroend(struct man *m)
/* ARGSUSED */
static int
-man_args(struct man *man, int line,
+man_args(struct man *m, int line,
int *pos, char *buf, char **v)
{
@@ -146,8 +145,10 @@ man_args(struct man *man, int line,
if (buf[*pos])
return(1);
- warnx("tail whitespace");
- return(-1);
+ if ( ! man_vwarn(m, line, *pos, "trailing spaces"))
+ return(-1);
+
+ return(1);
}
/*
@@ -162,8 +163,9 @@ man_args(struct man *man, int line,
(*pos)++;
if (0 == buf[*pos]) {
- warnx("unterminated quotation");
- return(-1);
+ if ( ! man_vwarn(m, line, *pos, "unterminated quote"))
+ return(-1);
+ return(1);
}
buf[(*pos)++] = 0;
@@ -176,6 +178,7 @@ man_args(struct man *man, int line,
if (buf[*pos])
return(1);
- warnx("tail whitespace");
- return(-1);
+ if ( ! man_vwarn(m, line, *pos, "trailing spaces"))
+ return(-1);
+ return(1);
}