changeset 6559:22f164bd7e8e v7.4.606

updated for version 7.4.606 Problem: May crash when using a small window. Solution: Avoid dividing by zero. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Tue, 27 Jan 2015 20:59:31 +0100
parents 27aff52a3989
children 1c3edaa53f13
files src/normal.c src/version.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/normal.c
+++ b/src/normal.c
@@ -4457,6 +4457,8 @@ nv_screengo(oap, dir, dist)
     col_off2 = col_off1 - curwin_col_off2();
     width1 = W_WIDTH(curwin) - col_off1;
     width2 = W_WIDTH(curwin) - col_off2;
+    if (width2 == 0)
+	width2 = 1; /* avoid divide by zero */
 
 #ifdef FEAT_VERTSPLIT
     if (curwin->w_width != 0)
--- 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 */
 /**/
+    606,
+/**/
     605,
 /**/
     604,