diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 21:31:07 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 21:31:07 +0000 |
| commit | 5dc6cc42f45870f511ac8eb8a1afcffcdfd88435 (patch) | |
| tree | 2fa1f2aa7a1f7a446f26d2e5084ab0f1f1b58d0d /contrib/less/input.c | |
| parent | dbc595b2aef4a0b0f115d7297ee1234f6ade8d21 (diff) | |
| parent | 5fc656f1876fd2ec306182f830049874b23fbfa3 (diff) | |
Notes
Diffstat (limited to 'contrib/less/input.c')
| -rw-r--r-- | contrib/less/input.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/contrib/less/input.c b/contrib/less/input.c index b211323e50dfe..9419a02711b53 100644 --- a/contrib/less/input.c +++ b/contrib/less/input.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2012 Mark Nudelman + * Copyright (C) 1984-2015 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -60,6 +60,7 @@ get_forw_line: } #if HILITE_SEARCH if (hilite_search == OPT_ONPLUS || is_filtering() || status_col) + { /* * If we are ignoring EOI (command F), only prepare * one line ahead, to avoid getting stuck waiting for @@ -69,6 +70,8 @@ get_forw_line: */ prep_hilite(curr_pos, curr_pos + 3*size_linebuf, ignore_eoi ? 1 : -1); + curr_pos = next_unfiltered(curr_pos); + } #endif if (ch_seek(curr_pos)) { @@ -439,19 +442,22 @@ set_attnpos(pos) { c = ch_forw_get(); if (c == EOI) - return; - if (c != '\n' && c != '\r') break; + if (c == '\n' || c == '\r') + { + (void) ch_back_get(); + break; + } pos++; } + end_attnpos = pos; + for (;;) + { + c = ch_back_get(); + if (c == EOI || c == '\n' || c == '\r') + break; + pos--; + } } start_attnpos = pos; - for (;;) - { - c = ch_forw_get(); - pos++; - if (c == EOI || c == '\n' || c == '\r') - break; - } - end_attnpos = pos; } |
