# HG changeset patch # User Bram Moolenaar # Date 1436716377 -7200 # Node ID 30c9301f33ed76d0b76b9e22362f5e78e26786da # Parent 4b0a26cbea815b4da7221b12a6cf41f34e2988a0 patch 7.4.781 Problem: line2byte() returns one less when 'bin' and 'noeol' are set. Solution: Only adjust the size for the last line. (Rob Wu) diff --git a/src/memline.c b/src/memline.c --- a/src/memline.c +++ b/src/memline.c @@ -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; } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 781, +/**/ 780, /**/ 779,