summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lumsden <lum@cvs.openbsd.org>2016-04-12 06:20:51 +0000
committerMark Lumsden <lum@cvs.openbsd.org>2016-04-12 06:20:51 +0000
commit0d9ed0b375340d0f5b629eaf29a9ca093a2b7082 (patch)
tree5db99d5d436300c13362a0e864a1a2b2bf65717a
parenta388f5da8beb9b254abcb7d8a6b341a7fc59c35a (diff)
Stop mg putting a space at the end of a paragraph when using
fill-paragraph. Reported by Harald Dunkel.
-rw-r--r--usr.bin/mg/paragraph.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mg/paragraph.c b/usr.bin/mg/paragraph.c
index c756fd877e8..58237c09998 100644
--- a/usr.bin/mg/paragraph.c
+++ b/usr.bin/mg/paragraph.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paragraph.c,v 1.42 2015/12/14 03:25:59 mmcc Exp $ */
+/* $OpenBSD: paragraph.c,v 1.43 2016/04/12 06:20:50 lum Exp $ */
/* This file is in the public domain. */
@@ -208,13 +208,13 @@ fillpara(int f, int n)
* behave the same way if a ')' is preceded by a
* [.?!] and followed by a doublespace.
*/
- if ((eolflag ||
+ if (!eopflag && ((eolflag ||
curwp->w_doto == llength(curwp->w_dotp) ||
(c = lgetc(curwp->w_dotp, curwp->w_doto)) == ' '
|| c == '\t') && (ISEOSP(wbuf[wordlen - 1]) ||
(wbuf[wordlen - 1] == ')' && wordlen >= 2 &&
ISEOSP(wbuf[wordlen - 2]))) &&
- wordlen < MAXWORD - 1)
+ wordlen < MAXWORD - 1))
wbuf[wordlen++] = ' ';
/* at a word break with a word waiting */