summaryrefslogtreecommitdiffstats
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
commit9535c4c28a7a16a87743e42c0c963c978c66bbe6 (patch)
tree70a2aa2a96ee74defacdb0fc225bde340be51774
parent1455968b313b58229631f0bab810b23bddda5bec (diff)
downloadmandoc-9535c4c28a7a16a87743e42c0c963c978c66bbe6.tar.gz
Bugfix: When a line ends with '\ \"', don't strip the trailing space
because that turned it into a bogus line continuation.
-rw-r--r--roff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/roff.c b/roff.c
index 705fddeb..05873d89 100644
--- a/roff.c
+++ b/roff.c
@@ -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;