From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Raise an error if a table is closed without data.
Date: Sat, 1 Jan 2011 11:10:40 -0500 (EST) [thread overview]
Message-ID: <201101011610.p01GAei7031578@krisdoz.my.domain> (raw)
Log Message:
-----------
Raise an error if a table is closed without data.
Modified Files:
--------------
mdocml:
libroff.h
roff.c
tbl.c
Revision Data
-------------
Index: tbl.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tbl.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -Ltbl.c -Ltbl.c -u -p -r1.13 -r1.14
--- tbl.c
+++ tbl.c
@@ -116,10 +116,15 @@ tbl_free(struct tbl *p)
}
void
-tbl_restart(struct tbl *tbl)
+tbl_restart(int line, int pos, struct tbl *tbl)
{
tbl->part = TBL_PART_LAYOUT;
+ tbl->line = line;
+ tbl->pos = pos;
+
+ if (NULL == tbl->first_span || NULL == tbl->first_span->first)
+ TBL_MSG(tbl, MANDOCERR_TBLNODATA, tbl->line, tbl->pos);
}
const struct tbl_span *
@@ -137,3 +142,4 @@ tbl_end(struct tbl *tbl)
if (NULL == tbl->first_span || NULL == tbl->first_span->first)
TBL_MSG(tbl, MANDOCERR_TBLNODATA, tbl->line, tbl->pos);
}
+
Index: roff.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -Lroff.c -Lroff.c -u -p -r1.115 -r1.116
--- roff.c
+++ roff.c
@@ -1138,7 +1138,7 @@ roff_T_(ROFF_ARGS)
if (NULL == r->tbl)
(*r->msg)(MANDOCERR_NOSCOPE, r->data, ln, ppos, NULL);
else
- tbl_restart(r->tbl);
+ tbl_restart(ppos, ln, r->tbl);
return(ROFF_IGN);
}
Index: libroff.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libroff.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -Llibroff.h -Llibroff.h -u -p -r1.12 -r1.13
--- libroff.h
+++ libroff.h
@@ -54,7 +54,7 @@ struct tbl {
(*(tblp)->msg)((type), (tblp)->data, (line), (col), NULL)
struct tbl *tbl_alloc(int, int, void *, mandocmsg);
-void tbl_restart(struct tbl *);
+void tbl_restart(int, int, struct tbl *);
void tbl_free(struct tbl *);
void tbl_reset(struct tbl *);
enum rofferr tbl_read(struct tbl *, int, const char *, int);
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2011-01-01 16:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201101011610.p01GAei7031578@krisdoz.my.domain \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).