Skip to content

Commit

Permalink
patch 7.4.781
Browse files Browse the repository at this point in the history
Problem:    line2byte() returns one less when 'bin' and 'noeol' are set.
Solution:   Only adjust the size for the last line. (Rob Wu)
  • Loading branch information
brammool committed Jul 12, 2015
1 parent 1db43b1 commit fe6f186
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/memline.c
Original file line number Diff line number Diff line change
Expand Up @@ -5362,7 +5362,7 @@ ml_find_line_or_offset(buf, lnum, offp)
size += lnum - 1;

/* Don't count the last line break if 'bin' and 'noeol'. */
if (buf->b_p_bin && !buf->b_p_eol)
if (buf->b_p_bin && !buf->b_p_eol && buf->b_ml.ml_line_count == lnum)
size -= ffdos + 1;
}

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
781,
/**/
780,
/**/
Expand Down

0 comments on commit fe6f186

Please sign in to comment.