diff options
author | 2018-08-18 22:04:32 +0000 | |
---|---|---|
committer | 2018-08-18 22:04:32 +0000 | |
commit | 007a2a0135c89a44d667626f348ce347d203c07d (patch) | |
tree | 8fbca0c03e1bbbcf859a2cc31e1da3e610cbbfac | |
parent | support the highly surprising escape sequence \# (line continuation (diff) | |
download | wireguard-openbsd-007a2a0135c89a44d667626f348ce347d203c07d.tar.xz wireguard-openbsd-007a2a0135c89a44d667626f348ce347d203c07d.zip |
Bugfix: When a line ends with '\ \"', don't strip the trailing space
because that turned it into a bogus line continuation.
-rw-r--r-- | usr.bin/mandoc/roff.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index 1e8b65eaef6..b889e9f4a91 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: roff.c,v 1.206 2018/08/18 21:36:53 schwarze Exp $ */ +/* $OpenBSD: roff.c,v 1.207 2018/08/18 22:04:32 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> @@ -1212,7 +1212,8 @@ roff_res(struct roff *r, struct buf *buf, int ln, int pos) /* Discard normal comments. */ - while (stesc > start && stesc[-1] == ' ') + while (stesc > start && stesc[-1] == ' ' && + (stesc == start + 1 || stesc[-2] != '\\')) stesc--; *stesc = '\0'; break; |