text: properly unindent lines that consist of only whitespace

The preceding 'for' loop has already established that all the lines are
either unindentable or composed of only blanks.  So if now a line cannot
be unindented, it means it is fully blank, so it can be simply skipped.

This fixes https://savannah.gnu.org/bugs/?51760.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
master
Benno Schulenberg 2017-08-16 16:32:18 +02:00
parent c3de3ece32
commit bd770ea2e7
1 changed files with 1 additions and 1 deletions

View File

@ -413,7 +413,7 @@ void do_unindent(void)
size_t indent_len = length_of_white(f->data);
/* If the line consists of a small amount of whitespace, skip it. */
if (white_string(f->data) && indent_len < tabsize)
if (indent_len == 0)
continue;
/* Remove the first tab's worth of whitespace from this line. */