[patch] fix another End keypress lockup in the viewer

Jindrich Makovicka makovick at kmlinux.fjfi.cvut.cz
Sun Aug 14 15:42:45 UTC 2005


Hello,

the new viewer has a problem with viewing files with DOS line
separators, which manifests again in a lockup after pressing the End
key. Then, it is impossible to move the view further, except by pressing
the Home key.

It is caused by the code of view_move_up, which moves by one line using
view_coord_to_offset() and then view_offset_to_coord() with offset
decremented by one. In the case of 0d/0a separator, the decremented
offset points to 0d, and view_offset_to_coord() returns the same coords.

The attached patch fixes the issue by decrementing the offset until
something else than 0d appears.

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/80f57f0f/attachment.diff>


More information about the mc-devel mailing list