[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

zile crash at *scratch* when press C+/.

From: Acoret
Subject: zile crash at *scratch* when press C+/.
Date: Sun, 6 Feb 2022 01:19:39 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1

when zile try to undo at *scratch* buffer and there is last undo, zile
will crash.

it's easy to check it by start zile, and switch it into *scratch* buffer, 
press the undo hotkey.

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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]