[patch] interruptible search in the viewer
Jindrich Makovicka
makovick at kmlinux.fjfi.cvut.cz
Sun Aug 14 17:16:05 UTC 2005
The attached patch makes the search function interruptible by Ctrl-C.
It also removes redundant got_interrupt() calls before
enable_interrupt_key(), as enable_interrupt_key() takes care of clearing
the interrupt flag itself. Furthermore, this feature makes search
virtually uninterruptible, because the flags gets constantly cleared and
the ocassional got_interrupt() check has no chance to catch the
keypress. After removing the disable/enable pair in the middle of the
loop, it works fine. I am not sure it it doesn't interfere with
get_byte() stuff which can do some I/O, but block_search doesn't disable
the interrupts during I/O either.
If you still want to use the approach with temporary disabled
interrupts, please at least move the check right before
enable_interrupt_key(), where it has some sense - it doesn't work 100%,
but it is at least possible to stop the search after a while of Ctrl-C
bashing.
Best regards,
--
Jindrich Makovicka
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: view.c.diff
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20050814/a8edf1d7/attachment.diff>
More information about the mc-devel
mailing list