summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-05-16 01:35:37 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-05-16 01:35:37 +0000
commit110ec8e74f50c3c583a7b5930b26eede65e6f8e7 (patch)
tree4788d50077cc4281f5c5c98b0e841a45c6913545
parent95167efd6516f34385b6878dd2f043182e743e05 (diff)
downloadmandoc-110ec8e74f50c3c583a7b5930b26eede65e6f8e7.tar.gz
sync to OpenBSD:
introduce a #define to get rid of the magic number describing the ASCII character used to represent non-breaking space; ok kristaps
-rw-r--r--chars.h2
-rw-r--r--chars.in2
-rw-r--r--term.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/chars.h b/chars.h
index a18c2880..a5b21396 100644
--- a/chars.h
+++ b/chars.h
@@ -17,6 +17,8 @@
#ifndef CHARS_H
#define CHARS_H
+#define ASCII_NBRSP 31 /* non-breaking space */
+
__BEGIN_DECLS
enum chars {
diff --git a/chars.in b/chars.in
index b2580115..14b80de7 100644
--- a/chars.in
+++ b/chars.in
@@ -31,7 +31,7 @@
*/
/* Non-breaking, non-collapsing space uses unit separator. */
-static const char ascii_nbrsp[2] = { 31, 0 };
+static const char ascii_nbrsp[2] = { ASCII_NBRSP, 0 };
CHAR_TBL_START
diff --git a/term.c b/term.c
index 8d612bbf..dc16c424 100644
--- a/term.c
+++ b/term.c
@@ -233,7 +233,7 @@ term_flushln(struct termp *p)
for ( ; i < (int)p->col; i++)
if (' ' == p->buf[i])
break;
- else if (31 == p->buf[i])
+ else if (ASCII_NBRSP == p->buf[i])
putchar(' ');
else
putchar(p->buf[i]);