aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-08-07 20:57:33 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-08-07 20:57:33 +0000
commit2e99d649451cc990d3b8e8663705ad2ef1c25eb1 (patch)
tree1dc5ffc2d1c4f3ccc45aa892c57f0e545c81a73e
parentcc281721217973092f10a3c7a71ce0004c65dbb8 (diff)
downloadmandoc-2e99d649451cc990d3b8e8663705ad2ef1c25eb1.tar.gz
mandoc-2e99d649451cc990d3b8e8663705ad2ef1c25eb1.tar.zst
mandoc-2e99d649451cc990d3b8e8663705ad2ef1c25eb1.zip
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.
-rw-r--r--man.c14
-rw-r--r--mdoc.c15
2 files changed, 4 insertions, 25 deletions
diff --git a/man.c b/man.c
index b35d7e07..bf65d919 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.84 2010/07/22 23:03:15 kristaps Exp $ */
+/* $Id: man.c,v 1.85 2010/08/07 20:57:33 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -21,7 +21,6 @@
#include <sys/types.h>
#include <assert.h>
-#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
@@ -483,21 +482,12 @@ man_pmacro(struct man *m, int ln, char *buf, int offs)
/* 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';
if (j == 4 || j < 1) {
diff --git a/mdoc.c b/mdoc.c
index 168e4cea..afe80b48 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.160 2010/08/07 20:33:55 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.161 2010/08/07 20:57:33 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -22,7 +22,6 @@
#include <sys/types.h>
#include <assert.h>
-#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -781,22 +780,12 @@ mdoc_pmacro(struct mdoc *m, int ln, char *buf, int offs)
* 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';
if (j == 4 || j < 2) {