From 007a2a0135c89a44d667626f348ce347d203c07d Mon Sep 17 00:00:00 2001 From: schwarze Date: Sat, 18 Aug 2018 22:04:32 +0000 Subject: [PATCH] Bugfix: When a line ends with '\ \"', don't strip the trailing space because that turned it into a bogus line continuation. --- usr.bin/mandoc/roff.c | 5 +++-- 1 file 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 * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze @@ -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; -- 2.20.1