From: Andrew Borodin Date: Wed, 23 Jan 2013 06:57:18 +0000 (+0400) Subject: Ticket #2953: (edit_move_to_prev_col): fix floating point exception. X-Git-Tag: 4.8.8~28^2~1 X-Git-Url: https://repo.or.cz/w/midnight-commander.git/commitdiff_plain/e553caecce3c5701439f1753e1273c040bda3fcb Ticket #2953: (edit_move_to_prev_col): fix floating point exception. Signed-off-by: Andrew Borodin --- diff --git a/src/editor/edit.c b/src/editor/edit.c index e1c753fae..a9f685f99 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -3256,13 +3256,17 @@ edit_move_to_prev_col (WEdit * edit, off_t p) edit->over_col = 0; if (option_fake_half_tabs && is_in_indent (edit)) { + long fake_half_tabs; + edit_update_curs_col (edit); - if (space_width != 0 && edit->curs_col % (HALF_TAB_SIZE * space_width) != 0) + + fake_half_tabs = HALF_TAB_SIZE * space_width; + if (fake_half_tabs != 0 && edit->curs_col % fake_half_tabs != 0) { int q; q = edit->curs_col; - edit->curs_col -= (edit->curs_col % (HALF_TAB_SIZE * space_width)); + edit->curs_col -= (edit->curs_col % fake_half_tabs); p = edit_bol (edit, edit->curs1); edit_cursor_move (edit, edit_move_forward3 (edit, p, edit->curs_col, 0) - edit->curs1);