* mdocml: warn about trailing whitespace at the end of comments; missing
@ 2016-11-10 12:48 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2016-11-10 12:48 UTC (permalink / raw)
To: source
Log Message:
-----------
warn about trailing whitespace at the end of comments;
missing feature noticed by jmc@
Modified Files:
--------------
mdocml:
read.c
Revision Data
-------------
Index: read.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/read.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -Lread.c -Lread.c -u -p -r1.152 -r1.153
--- read.c
+++ read.c
@@ -423,11 +423,17 @@ mparse_buf_r(struct mparse *curp, struct
i += 2;
/* Comment, skip to end of line */
for (; i < blk.sz; ++i) {
- if ('\n' == blk.buf[i]) {
- ++i;
- ++lnn;
- break;
- }
+ if (blk.buf[i] != '\n')
+ continue;
+ if (blk.buf[i - 1] == ' ' ||
+ blk.buf[i - 1] == '\t')
+ mandoc_msg(
+ MANDOCERR_SPACE_EOL,
+ curp, curp->line,
+ pos, NULL);
+ ++i;
+ ++lnn;
+ break;
}
/* Backout trailing whitespaces */
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-10 12:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10 12:48 mdocml: warn about trailing whitespace at the end of comments; missing schwarze
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).