From 9d499c769bf172c0e7fdac4028a8a7649bec9f6c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 10 Mar 2020 10:56:05 +0100 Subject: [PATCH] justify: do not take an empty line as template for first-line indentation This fixes https://savannah.gnu.org/bugs/?57437. --- src/text.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/text.c b/src/text.c index 691306cb..7c368748 100644 --- a/src/text.c +++ b/src/text.c @@ -1789,6 +1789,10 @@ void do_justify(bool full_justify) while (sampleline->prev && inpar(sampleline) && !begpar(sampleline, 0)) sampleline = sampleline->prev; + /* Ignore lines that contain no text. */ + while (sampleline->next && !inpar(sampleline)) + sampleline = sampleline->next; + /* Store the leading part that is to be used for the new paragraph. */ quot_len = quote_length(sampleline->data); lead_len = quot_len + indent_length(sampleline->data + quot_len);