summaryrefslogtreecommitdiffstats
path: root/mdocterm.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-02-23 15:34:53 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-02-23 15:34:53 +0000
commit61ed3cda9170f4f414c6f2d577c68533f7bfe154 (patch)
tree47b541df9c9d8066ace5d426dc3d63271d46be5a /mdocterm.c
parent0433d239533d292f8994aa02fe4bd7d8eacd2bb5 (diff)
downloadmandoc-61ed3cda9170f4f414c6f2d577c68533f7bfe154.tar.gz
Compiles fine on NetBSD now, too.
Diffstat (limited to 'mdocterm.c')
-rw-r--r--mdocterm.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/mdocterm.c b/mdocterm.c
index 4174ff01..10b4b8d8 100644
--- a/mdocterm.c
+++ b/mdocterm.c
@@ -24,13 +24,19 @@
#include <stdlib.h>
#include <string.h>
-#ifdef __linux__
+#ifndef __OpenBSD__
#include <time.h>
#endif
#include "mmain.h"
#include "term.h"
+#ifdef __NetBSD__
+#define xisspace(x) isspace((int)(x))
+#else
+#define xisspace(x) isspace((x))
+#endif
+
enum termstyle {
STYLE_CLEAR,
STYLE_BOLD,
@@ -137,11 +143,11 @@ flushln(struct termp *p)
* Count up visible word characters. Control sequences
* (starting with the CSI) aren't counted.
*/
- assert( ! isspace(p->buf[i]));
+ assert( ! xisspace(p->buf[i]));
/* LINTED */
for (j = i, vsz = 0; j < p->col; j++) {
- if (isspace(p->buf[j]))
+ if (xisspace(p->buf[j]))
break;
else if (27 == p->buf[j]) {
assert(j + 4 <= p->col);
@@ -177,7 +183,7 @@ flushln(struct termp *p)
*/
for ( ; i < p->col; i++) {
- if (isspace(p->buf[i]))
+ if (xisspace(p->buf[i]))
break;
putchar(p->buf[i]);
}
@@ -378,7 +384,7 @@ word(struct termp *p, const char *word)
/* LINTED */
for (j = i = 0; i < len; i++) {
- if ( ! isspace(word[i])) {
+ if ( ! xisspace(word[i])) {
j++;
continue;
}
@@ -444,10 +450,10 @@ footer(struct termp *p, const struct mdoc_meta *meta)
tm = localtime(&meta->date);
-#ifdef __linux__
- if (0 == strftime(buf, p->rmargin, "%B %d, %Y", tm))
-#else
+#ifdef __OpenBSD__
if (NULL == strftime(buf, p->rmargin, "%B %d, %Y", tm))
+#else
+ if (0 == strftime(buf, p->rmargin, "%B %d, %Y", tm))
#endif
err(1, "strftime");