[Midnight Commander] #4391: Delete editor macro results in infinite loop

0 views
Skip to first unread message

Ticket System

unread,
Jul 21, 2022, 10:04:21 PM7/21/22
to sxm...@gmail.com, mc-...@googlegroups.com
#4391: Delete editor macro results in infinite loop
--------------------------+----------------------------------
Reporter: sxmboer2 | Type: defect
Status: new | Priority: major
Milestone: 4.8.29 | Component: mcedit
Version: master | Keywords: macro edit
Blocked By: | Blocking:
Branch state: no branch | Votes for changeset:
--------------------------+----------------------------------
Since version 4.8.27 removing an existing macro results in an infinite
loop that dumps a repeating series of array assertion error.

To reproduce:
create a macro, e.g. CTRL-R abc CTRL-R a
remove that macro, e.g. CTRL-R CTRL-R a (or use the menu to delete that
macro)

The problem was introduced because of the split of the macro functions
with some rewrites and optimizations. I am including a patch that also
gets rid of the unnecessary resorting of the macro array. The glib
function called keeps the array sorted.
Another thought is that the while construction can be replaced with a
single if. In principle it is impossible to have more than one macro with
the same hotkey.

--
Ticket URL: <http://www.midnight-commander.org/ticket/4391>
Midnight Commander <https://midnight-commander.org>
Midnight Development Center

Ticket System

unread,
Jul 22, 2022, 9:06:43 AM7/22/22
to sxm...@gmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4391: Delete editor macro results in infinite loop
--------------------------+----------------------------------
Reporter: sxmboer2 | Owner: andrew_b
Type: defect | Status: accepted

Priority: major | Milestone: 4.8.29
Component: mcedit | Version: master
Resolution: | Keywords: macro edit

Blocked By: | Blocking:
Branch state: no branch | Votes for changeset:
--------------------------+----------------------------------
Changes (by andrew_b):

* status: new => accepted
* owner: => andrew_b


--
Ticket URL: <http://www.midnight-commander.org/ticket/4391#comment:1>

Ticket System

unread,
Jul 22, 2022, 9:25:27 AM7/22/22
to sxm...@gmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4391: Delete editor macro results in infinite loop
--------------------------+----------------------------------
Reporter: sxmboer2 | Owner: andrew_b
Type: defect | Status: accepted
Priority: major | Milestone: 4.8.29
Component: mcedit | Version: master
Resolution: | Keywords: macro edit
Blocked By: | Blocking:
Branch state: on review | Votes for changeset:
--------------------------+----------------------------------
Changes (by andrew_b):

* branch_state: no branch => on review


Comment:

Thanks!

I've split your patch to two commits.

Branch:4391_edit_delete_macro
Initial changeset:c90840d5c7f577f453f8cc810527d078080e41e9

--
Ticket URL: <http://www.midnight-commander.org/ticket/4391#comment:2>

Ticket System

unread,
Jul 27, 2022, 12:21:32 PM7/27/22
to sxm...@gmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4391: Delete editor macro results in infinite loop
-------------------------+----------------------------------
Reporter: sxmboer2 | Owner: andrew_b
Type: defect | Status: accepted
Priority: major | Milestone: 4.8.29
Component: mcedit | Version: master
Resolution: | Keywords: macro edit
Blocked By: | Blocking:
Branch state: approved | Votes for changeset: andrew_b
-------------------------+----------------------------------
Changes (by andrew_b):

* votes: => andrew_b
* branch_state: on review => approved


--
Ticket URL: <http://www.midnight-commander.org/ticket/4391#comment:3>

Ticket System

unread,
Jul 27, 2022, 12:24:17 PM7/27/22
to sxm...@gmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4391: Delete editor macro results in infinite loop
-------------------------+----------------------------------------
Reporter: sxmboer2 | Owner: andrew_b
Type: defect | Status: testing

Priority: major | Milestone: 4.8.29
Component: mcedit | Version: master
Resolution: fixed | Keywords: macro edit
Blocked By: | Blocking:
Branch state: merged | Votes for changeset: committed-master
-------------------------+----------------------------------------
Changes (by andrew_b):

* status: accepted => testing
* votes: andrew_b => committed-master
* resolution: => fixed
* branch_state: approved => merged


Comment:

Merged to master: [1c31e57c74b533c4d54e4a1bdd8dd1684c7ef86f].
{{{
git log --pretty=oneline 82da1e88c..1c31e57c7
}}}

--
Ticket URL: <http://www.midnight-commander.org/ticket/4391#comment:4>

Ticket System

unread,
Jul 27, 2022, 12:25:36 PM7/27/22
to sxm...@gmail.com, andrew....@gmail.com, mc-...@googlegroups.com
#4391: Delete editor macro results in infinite loop
-------------------------+----------------------------------------
Reporter: sxmboer2 | Owner: andrew_b
Type: defect | Status: closed

Priority: major | Milestone: 4.8.29
Component: mcedit | Version: master
Resolution: fixed | Keywords: macro edit
Blocked By: | Blocking:

Branch state: merged | Votes for changeset: committed-master
-------------------------+----------------------------------------
Changes (by andrew_b):

* status: testing => closed


--
Ticket URL: <http://www.midnight-commander.org/ticket/4391#comment:5>

Reply all
Reply to author
Forward
0 new messages