justify: reduce the character count when trimming trailing spaces

This fixes https://savannah.gnu.org/bugs/?50379.
master
Benno Schulenberg 2017-02-22 17:24:10 +01:00
parent 23c3fd9bcd
commit de3260cdb1
1 changed files with 2 additions and 1 deletions

View File

@ -2445,10 +2445,11 @@ void do_justify(bool full_justify)
#endif #endif
/* Break the current line. */ /* Break the current line. */
if (ISSET(JUSTIFY_TRIM)) { if (ISSET(JUSTIFY_TRIM)) {
while (break_pos > 0 && while (break_pos > 0 &&
is_blank_mbchar(&openfile->current->data[break_pos - 1])) { is_blank_mbchar(&openfile->current->data[break_pos - 1])) {
break_pos--; break_pos--;
openfile->totsize--;
} }
} }
null_at(&openfile->current->data, break_pos); null_at(&openfile->current->data, break_pos);