[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
zile undo bug at *scratch* buffer
From: |
acoret |
Subject: |
zile undo bug at *scratch* buffer |
Date: |
Mon, 18 Oct 2021 00:21:20 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
when zile try to undo at *scratch* buffer and there is last undo, zile
will crash.
after check last_undo maybe null, so revert_action may receive null, so
it require to check if is null
Index: zile-2.6.2/src/undo.vala
==================================================================
--- zile-2.6.2/src/undo.vala
+++ zile-2.6.2/src/undo.vala
@@ -83,13 +83,14 @@
/*
* Revert an action. Return the next undo entry.
*/
List<Undo> *revert_action (List<Undo> *l) {
if (l->data.type == END_SEQUENCE)
- for (l = l->next; l->data.type != START_SEQUENCE; l = revert_action (l))
+ for (l = l->next; l != null && l->data.type != START_SEQUENCE; l =
revert_action (l))
;
-
+ if (l == null)
+ return null;
if (l->data.type != END_SEQUENCE)
cur_bp.goto_offset (l->data.o);
if (l->data.type == SAVE_BLOCK)
cur_bp.replace_estr (l->data.size, l->data.text);
if (l->data.unchanged)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- zile undo bug at *scratch* buffer,
acoret <=