commit d6beca5dcf46fd08e2322f357e7c7227a575e94b
parent 9d7e62be1ada90d6f3732b5aba1e8dafeb3118ad
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 8 Mar 2020 15:07:33 +0100
justify: do not copy too many bytes when trimming leading whitespace
This fixes https://savannah.gnu.org/bugs/?57972.
Bug existed since version 4.0, commit 877a6498.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/text.c b/src/text.c
@@ -1870,7 +1870,7 @@ void do_justify(bool full_justify)
if (indent_len > 0)
memmove(cutbuffer->data + lead_len,
cutbuffer->data + lead_len + indent_len,
- line_len - indent_len + 1);
+ line_len - lead_len - indent_len + 1);
/* If the marked region ends in the middle of a line, and this line
* has a leading part, check if the last line of the extracted region