patch 8.1.0303: line2byte() is wrong for last line with 'noeol'
Problem: line2byte() is wrong for last line with 'noeol' and 'nofixeol'.
Solution: Fix off-by-one error. (Shane Harper, closes #3351)
diff --git a/src/memline.c b/src/memline.c
index a2f0b4f..fb262ac 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -5267,7 +5267,7 @@
/* Don't count the last line break if 'noeol' and ('bin' or
* 'nofixeol'). */
if ((!buf->b_p_fixeol || buf->b_p_bin) && !buf->b_p_eol
- && buf->b_ml.ml_line_count == lnum)
+ && lnum > buf->b_ml.ml_line_count)
size -= ffdos + 1;
}