summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-06-14 18:23:27 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-06-14 18:23:27 +0000
commit647e680d5fef70a7afeedebf08d788cecc26da58 (patch)
treecba4cfe3a4f7520bcbcf54bb16612e21a8c2fc80 /usr.bin/mandoc
parent80ac93be26e104b44e59db20f822b3f1b3727034 (diff)
let \l use the right fill character
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/out.c6
-rw-r--r--usr.bin/mandoc/term.c12
2 files changed, 8 insertions, 10 deletions
diff --git a/usr.bin/mandoc/out.c b/usr.bin/mandoc/out.c
index 684d6ecb527..a0607fdf076 100644
--- a/usr.bin/mandoc/out.c
+++ b/usr.bin/mandoc/out.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: out.c,v 1.39 2017/06/12 22:05:41 schwarze Exp $ */
+/* $OpenBSD: out.c,v 1.40 2017/06/14 18:23:26 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -83,10 +83,8 @@ a2roffsu(const char *src, struct roffsu *dst, enum roffscale def)
case 'v':
dst->unit = SCALE_VS;
break;
- case '\0':
- endptr--;
- /* FALLTHROUGH */
default:
+ endptr--;
if (SCALE_MAX == def)
return NULL;
dst->unit = def;
diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c
index 9c93a3a90a5..0f59fdc5439 100644
--- a/usr.bin/mandoc/term.c
+++ b/usr.bin/mandoc/term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: term.c,v 1.131 2017/06/14 17:50:43 schwarze Exp $ */
+/* $OpenBSD: term.c,v 1.132 2017/06/14 18:23:26 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -545,7 +545,7 @@ term_word(struct termp *p, const char *word)
}
continue;
case ESCAPE_HLINE:
- if ((seq = a2roffsu(seq, &su, SCALE_EM)) == NULL)
+ if ((cp = a2roffsu(seq, &su, SCALE_EM)) == NULL)
continue;
uc = term_hen(p, &su);
if (uc <= 0) {
@@ -554,10 +554,10 @@ term_word(struct termp *p, const char *word)
lsz = p->tcol->rmargin - p->tcol->offset;
} else
lsz = uc;
- if (*seq == '\0')
+ if (*cp == seq[-1])
uc = -1;
- else if (*seq == '\\') {
- seq++;
+ else if (*cp == '\\') {
+ seq = cp + 1;
esc = mandoc_escape(&seq, &cp, &sz);
switch (esc) {
case ESCAPE_UNICODE:
@@ -574,7 +574,7 @@ term_word(struct termp *p, const char *word)
break;
}
} else
- uc = *seq;
+ uc = *cp;
if (uc < 0x20 || (uc > 0x7E && uc < 0xA0))
uc = '_';
if (p->enc == TERMENC_ASCII) {