diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2013-05-29 15:15:50 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2013-05-29 15:15:50 +0000 |
commit | 6896c11351c94e4440d39d70824084a0168d095e (patch) | |
tree | 79cac2d34156ca2e9198960fe55561907c1b154d | |
parent | 1b243fb854e4ccca8cf1c10ed951c53d849f53c9 (diff) |
In keep mode, if any text is printed (even in NOSPACE mode),
any text that follows must be kept on the same line.
I already found the issue and wrote the patch in April 2011,
but didn't come round to do proper testing and forgot about it.
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bk/break.in | 9 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii | 8 | ||||
-rw-r--r-- | usr.bin/mandoc/term.c | 6 |
3 files changed, 18 insertions, 5 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Bk/break.in b/regress/usr.bin/mandoc/mdoc/Bk/break.in index 188dce29fec..ce3d5a9bbcc 100644 --- a/regress/usr.bin/mandoc/mdoc/Bk/break.in +++ b/regress/usr.bin/mandoc/mdoc/Bk/break.in @@ -1,4 +1,4 @@ -.Dd June 30, 2010 +.Dd $Mdocdate: May 29 2013 $ .Dt BK-BREAK 1 .Os OpenBSD .Sh NAME @@ -40,3 +40,10 @@ including just the macros to be kept together is sufficient: .Ar x x x x x x .Op o Ar a .Ek +.Pp +Even text printed without spacing must be kept together +with the text following it: +.Pp +.Bk -words +.Fn xxxxxxxxxxxxxxxxxxxx "xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx" xxxxxxxxxxxxxxxxxxxx +.Ek diff --git a/regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii b/regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii index 28cd8766bc7..a0b5145204d 100644 --- a/regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii +++ b/regress/usr.bin/mandoc/mdoc/Bk/break.out_ascii @@ -19,4 +19,10 @@ DDEESSCCRRIIPPTTIIOONN BBkk--bbrreeaakk _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x _x [o _a] -OpenBSD June 30, 2010 OpenBSD + Even text printed without spacing must be kept together with the text + following it: + + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x + _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x, _x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x) + +OpenBSD May 29, 2013 OpenBSD diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c index 945d8504423..51b4a8dc2aa 100644 --- a/usr.bin/mandoc/term.c +++ b/usr.bin/mandoc/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.67 2012/11/16 17:16:29 schwarze Exp $ */ +/* $Id: term.c,v 1.68 2013/05/29 15:15:49 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org> @@ -402,14 +402,14 @@ term_word(struct termp *p, const char *word) if ( ! (TERMP_NOSPACE & p->flags)) { if ( ! (TERMP_KEEP & p->flags)) { - if (TERMP_PREKEEP & p->flags) - p->flags |= TERMP_KEEP; bufferc(p, ' '); if (TERMP_SENTENCE & p->flags) bufferc(p, ' '); } else bufferc(p, ASCII_NBRSP); } + if (TERMP_PREKEEP & p->flags) + p->flags |= TERMP_KEEP; if ( ! (p->flags & TERMP_NONOSPACE)) p->flags &= ~TERMP_NOSPACE; |