source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Clean out the isgraph() checks in mdoc.c and man.c.
Date: Sat, 7 Aug 2010 16:57:34 -0400 (EDT)	[thread overview]
Message-ID: <201008072057.o77KvYCo002102@krisdoz.my.domain> (raw)

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

                 reply	other threads:[~2010-08-07 20:57 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=201008072057.o77KvYCo002102@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).