commit de3260cdb1d9dfe6b9da665e294a44df84388163
parent 23c3fd9bcd17c6843d1f513334815e2bdee99157
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Wed, 22 Feb 2017 17:24:10 +0100
justify: reduce the character count when trimming trailing spaces
This fixes https://savannah.gnu.org/bugs/?50379.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/text.c b/src/text.c
@@ -2445,10 +2445,11 @@ void do_justify(bool full_justify)
#endif
/* Break the current line. */
- if (ISSET(JUSTIFY_TRIM)) {
+ if (ISSET(JUSTIFY_TRIM)) {
while (break_pos > 0 &&
is_blank_mbchar(&openfile->current->data[break_pos - 1])) {
break_pos--;
+ openfile->totsize--;
}
}
null_at(&openfile->current->data, break_pos);