aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-18 22:05:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-18 22:05:43 +0000
commit6773fbde9b5bf91ad32caf6aefb8902ba59181fa (patch)
tree5771a12972c2b64452ef5a26c4b17579e32fb496 /roff.c
parent706d9945acc722dd472698b7a9a81d213d8d9e0f (diff)
downloadmandoc-6773fbde9b5bf91ad32caf6aefb8902ba59181fa.tar.gz
mandoc-6773fbde9b5bf91ad32caf6aefb8902ba59181fa.tar.zst
mandoc-6773fbde9b5bf91ad32caf6aefb8902ba59181fa.zip
Bugfix: When a line ends with '\ \"', don't strip the trailing space
because that turned it into a bogus line continuation.
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c5
1 files 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 <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;