From: schwarze Date: Sat, 18 Aug 2018 22:04:32 +0000 (+0000) Subject: Bugfix: When a line ends with '\ \"', don't strip the trailing space X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=007a2a0135c89a44d667626f348ce347d203c07d;p=openbsd Bugfix: When a line ends with '\ \"', don't strip the trailing space because that turned it into a bogus line continuation. --- 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;