vim-patch:7.4.606 #2594

Problem:    May crash when using a small window.
Solution:   Avoid dividing by zero. (Christian Brabandt)

https://github.com/vim/vim/commit/v7-4-606
This commit is contained in:
Yamakaky 2015-05-05 19:39:03 +02:00 committed by Justin M. Keyes
parent d956535307
commit 48bd94e98f
2 changed files with 5 additions and 1 deletions

View File

@ -3399,6 +3399,10 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
width1 = curwin->w_width - col_off1; width1 = curwin->w_width - col_off1;
width2 = curwin->w_width - col_off2; width2 = curwin->w_width - col_off2;
if (width2 == 0) {
width2 = 1; // Avoid divide by zero.
}
if (curwin->w_width != 0) { if (curwin->w_width != 0) {
/* /*
* Instead of sticking at the last character of the buffer line we * Instead of sticking at the last character of the buffer line we

View File

@ -177,7 +177,7 @@ static int included_patches[] = {
//609, //609,
//608, //608,
//607, //607,
//606, 606,
//605, //605,
//604, //604,
//603, //603,