patch 9.1.0113: duplicate code when cleaning undo stack
Problem: duplicate code when cleaning undo stack
Solution: refactor undo cleanup into a single public function
related: #13928
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/fileio.c b/src/fileio.c
index 180fe39..d293d71 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4514,10 +4514,7 @@
// Mark the buffer as unmodified and free undo info.
unchanged(buf, TRUE, TRUE);
if ((flags & READ_KEEP_UNDO) == 0)
- {
- u_blockfree(buf);
- u_clearall(buf);
- }
+ u_clearallandblockfree(buf);
else
{
// Mark all undo states as changed.