summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-08-18 22:04:33 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-08-18 22:04:33 +0000
commit8f80b6c60c9ef32e0352c735c340cbe6435708b6 (patch)
tree968471d174f9c2605281971c86adcdb14189d924 /usr.bin/mandoc
parent331f2be5ae7122e99bb116918ae7edf67556ff62 (diff)
Bugfix: When a line ends with '\ \"', don't strip the trailing space
because that turned it into a bogus line continuation.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/roff.c5
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;