diff --git a/src/viewer/ascii.c b/src/viewer/ascii.c
index d73a02bcb..b5991daff 100644
a
|
b
|
mcview_display_line (WView * view, mcview_state_machine_t * state, int row, |
610 | 610 | off_t eol; |
611 | 611 | int retval; |
612 | 612 | |
613 | | eol = mcview_eol (view, state->offset, mcview_get_filesize (view)); |
| 613 | eol = mcview_eol (view, state->offset); |
614 | 614 | retval = (eol > state->offset) ? 1 : 0; |
615 | 615 | |
616 | 616 | mcview_state_machine_init (state, eol); |
… |
… |
mcview_display_line (WView * view, mcview_state_machine_t * state, int row, |
752 | 752 | * parsing and then not actually displaying it. */ |
753 | 753 | off_t eol; |
754 | 754 | |
755 | | eol = mcview_eol (view, state->offset, mcview_get_filesize (view)); |
| 755 | eol = mcview_eol (view, state->offset); |
756 | 756 | mcview_state_machine_init (state, eol); |
757 | 757 | return 1; |
758 | 758 | } |
… |
… |
mcview_ascii_move_down (WView * view, off_t lines) |
957 | 957 | * EOF, that can't happen. */ |
958 | 958 | if (!view->text_wrap_mode) |
959 | 959 | { |
960 | | view->dpy_start = mcview_eol (view, view->dpy_start, mcview_get_filesize (view)); |
| 960 | view->dpy_start = mcview_eol (view, view->dpy_start); |
961 | 961 | view->dpy_paragraph_skip_lines = 0; |
962 | 962 | view->dpy_wrap_dirty = TRUE; |
963 | 963 | } |
diff --git a/src/viewer/internal.h b/src/viewer/internal.h
index fc020609c..194f507ef 100644
a
|
b
|
void mcview_select_encoding (WView * view); |
316 | 316 | void mcview_set_codeset (WView * view); |
317 | 317 | void mcview_show_error (WView * view, const char *error); |
318 | 318 | off_t mcview_bol (WView * view, off_t current, off_t limit); |
319 | | off_t mcview_eol (WView * view, off_t current, off_t limit); |
| 319 | off_t mcview_eol (WView * view, off_t current); |
320 | 320 | char *mcview_get_title (const WDialog * h, size_t len); |
321 | 321 | int mcview_calc_percent (WView * view, off_t p); |
322 | 322 | |
diff --git a/src/viewer/lib.c b/src/viewer/lib.c
index f16618438..73fa4ace1 100644
a
|
b
|
mcview_bol (WView * view, off_t current, off_t limit) |
357 | 357 | */ |
358 | 358 | |
359 | 359 | off_t |
360 | | mcview_eol (WView * view, off_t current, off_t limit) |
| 360 | mcview_eol (WView * view, off_t current) |
361 | 361 | { |
362 | 362 | int c, prev_ch = 0; |
363 | | off_t filesize; |
364 | | filesize = mcview_get_filesize (view); |
365 | 363 | if (current < 0) |
366 | 364 | return 0; |
367 | | if (current >= filesize) |
368 | | return filesize; |
369 | | while (current < filesize && current < limit) |
| 365 | while (TRUE) |
370 | 366 | { |
371 | 367 | if (!mcview_get_byte (view, current, &c)) |
372 | 368 | break; |