source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Also catch "new sentence, new line" if there are three blanks
@ 2017-06-07 20:59 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-06-07 20:59 UTC (permalink / raw)
  To: source

Log Message:
-----------
Also catch "new sentence, new line" if there are three blanks
between the sentences.  Thomas Klausner says he has seen some
of these, and i don't see any false positives.

Modified Files:
--------------
    mdocml:
        mdoc.c

Revision Data
-------------
Index: mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc.c,v
retrieving revision 1.265
retrieving revision 1.266
diff -Lmdoc.c -Lmdoc.c -u -p -r1.265 -r1.266
--- mdoc.c
+++ mdoc.c
@@ -280,12 +280,18 @@ mdoc_ptext(struct roff_man *mdoc, int li
 			continue;
 		if (end - c < 3)
 			break;
-		if (isalpha((unsigned char)c[-2]) &&
-		    isalpha((unsigned char)c[-1]) &&
-		    c[1] == ' ' &&
-		    isupper((unsigned char)(c[2] == ' ' ? c[3] : c[2])) &&
-		    (c[-2] != 'n' || c[-1] != 'c') &&
-		    (c[-2] != 'v' || c[-1] != 's'))
+		if (c[1] != ' ' ||
+		    isalpha((unsigned char)c[-2]) == 0 ||
+		    isalpha((unsigned char)c[-1]) == 0 ||
+		    (c[-2] == 'n' && c[-1] == 'c') ||
+		    (c[-2] == 'v' && c[-1] == 's'))
+			continue;
+		c += 2;
+		if (*c == ' ')
+			c++;
+		if (*c == ' ')
+			c++;
+		if (isupper((unsigned char)(*c)))
 			mandoc_msg(MANDOCERR_EOS, mdoc->parse,
 			    line, (int)(c - buf), NULL);
 	}
--
 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:[~2017-06-07 20:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07 20:59 mdocml: Also catch "new sentence, new line" if there are three blanks 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).