source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Clean out the isgraph() checks in mdoc.c and man.c.
@ 2010-08-07 20:57 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-08-07 20:57 UTC (permalink / raw)
  To: source

Log Message:
-----------
Clean out the isgraph() checks in mdoc.c and man.c.  These code paths
were never taken since main.c begin skipping over unrecognisable
characters, so they were noops.

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

Revision Data
-------------
Index: man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -Lman.c -Lman.c -u -p -r1.84 -r1.85
--- man.c
+++ man.c
@@ -21,7 +21,6 @@
 #include <sys/types.h>
 
 #include <assert.h>
-#include <ctype.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -483,20 +482,11 @@ man_pmacro(struct man *m, int ln, char *
 
 	/* Copy the first word into a nil-terminated buffer. */
 
-	for (j = 0; j < 4; j++, i++) {
+	for (j = 0; j < 4; j++, i++)
 		if ('\0' == (mac[j] = buf[i]))
 			break;
 		else if (' ' == buf[i])
 			break;
-
-		/* Check for invalid characters. */
-
-		if (isgraph((u_char)buf[i]))
-			continue;
-		if ( ! man_pmsg(m, ln, i, MANDOCERR_BADCHAR))
-			return(0);
-		i--;
-	}
 
 	mac[j] = '\0';
 
Index: mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -Lmdoc.c -Lmdoc.c -u -p -r1.160 -r1.161
--- mdoc.c
+++ mdoc.c
@@ -22,7 +22,6 @@
 #include <sys/types.h>
 
 #include <assert.h>
-#include <ctype.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -781,21 +780,11 @@ mdoc_pmacro(struct mdoc *m, int ln, char
 	 * copying when a tab, space, or eoln is encountered.
 	 */
 
-	for (j = 0; j < 4; j++, i++) {
+	for (j = 0; j < 4; j++, i++)
 		if ('\0' == (mac[j] = buf[i]))
 			break;
 		else if (' ' == buf[i] || '\t' == buf[i])
 			break;
-
-		/* Check for invalid characters. */
-		/* TODO: remove me, already done in main.c. */
-
-		if (isgraph((u_char)buf[i]))
-			continue;
-		if ( ! mdoc_pmsg(m, ln, i, MANDOCERR_BADCHAR))
-			return(0);
-		i--;
-	}
 
 	mac[j] = '\0';
 
--
 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:[~2010-08-07 20:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-07 20:57 mdocml: Clean out the isgraph() checks in mdoc.c and man.c kristaps

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).