summaryrefslogtreecommitdiffstats
path: root/mdocml.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-15 15:59:19 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-15 15:59:19 +0000
commitfbf268cbe56d069d49e3960a6a269662a47bbd79 (patch)
tree04b97c1febaea355c826315611b90de346855d9a /mdocml.c
parent56a9d2b7ed8dde26892ea1ba1b4e61495a3a8ee5 (diff)
downloadmandoc-fbf268cbe56d069d49e3960a6a269662a47bbd79.tar.gz
*** empty log message ***VERSION.1.1.0
Diffstat (limited to 'mdocml.c')
-rw-r--r--mdocml.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/mdocml.c b/mdocml.c
index 1e4f34d5..74e7910d 100644
--- a/mdocml.c
+++ b/mdocml.c
@@ -42,8 +42,6 @@ struct md_parse {
u_long bufsz;
char *name;
int fd;
- int lnn;
- char *line;
};
static void usage(void);
@@ -278,6 +276,7 @@ parse_begin(struct md_parse *p)
size_t pos;
char line[256], sv[256];
struct mdoc_cb cb;
+ int lnn;
cb.mdoc_err = msg_err;
cb.mdoc_warn = msg_warn;
@@ -286,10 +285,7 @@ parse_begin(struct md_parse *p)
if (NULL == (p->mdoc = mdoc_alloc(p, &cb)))
return(parse_leave(p, 0));
- p->lnn = 1;
- p->line = sv;
-
- for (pos = 0; ; ) {
+ for (lnn = 1, pos = 0; ; ) {
if (-1 == (sz = read(p->fd, p->buf, p->bufsz))) {
warn("%s", p->name);
return(parse_leave(p, 0));
@@ -305,15 +301,15 @@ parse_begin(struct md_parse *p)
continue;
}
warnx("%s: line %d too long",
- p->name, p->lnn);
+ p->name, lnn);
return(parse_leave(p, 0));
}
line[(int)pos] = sv[(int)pos] = 0;
- if ( ! mdoc_parseln(p->mdoc, p->lnn, line))
+ if ( ! mdoc_parseln(p->mdoc, lnn, line))
return(parse_leave(p, 0));
- p->lnn++;
+ lnn++;
pos = 0;
}
}