From 6773fbde9b5bf91ad32caf6aefb8902ba59181fa Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 18 Aug 2018 22:05:43 +0000 Subject: Bugfix: When a line ends with '\ \"', don't strip the trailing space because that turned it into a bogus line continuation. --- roff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roff.c b/roff.c index bd8c8250..0c733006 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.334 2018/08/18 21:37:01 schwarze Exp $ */ +/* $Id: roff.c,v 1.335 2018/08/18 22:05:43 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze @@ -1214,7 +1214,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; -- cgit v1.2.3