un_maximize = FALSE;
#endif
}
+ limit_screen_size();
gui.num_cols = Columns;
gui.num_rows = Rows;
p_window = h - 1;
Rows = h;
}
+ limit_screen_size();
pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width);
pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height);
}
Columns = MIN_COLUMNS;
}
- /* Limit the values to avoid an overflow in Rows * Columns. */
- if (Columns > 10000)
- Columns = 10000;
- if (Rows > 1000)
- Rows = 1000;
+ limit_screen_size();
#ifdef DJGPP
/* avoid a crash by checking for a too large value of 'columns' */
Rows = rows;
Columns = columns;
+ limit_screen_size();
return OK;
}
void ttest __ARGS((int pairs));
void add_long_to_buf __ARGS((long_u val, char_u *dst));
void check_shellsize __ARGS((void));
+void limit_screen_size __ARGS((void));
void win_new_shellsize __ARGS((void));
void shell_resized __ARGS((void));
void shell_resized_check __ARGS((void));
#endif
/*
- * Check if the new shell size is valid, correct it if it's too small.
+ * Check if the new shell size is valid, correct it if it's too small or way
+ * too big.
*/
void
check_shellsize()
{
- if (Columns < MIN_COLUMNS)
- Columns = MIN_COLUMNS;
if (Rows < min_rows()) /* need room for one window and command line */
Rows = min_rows();
+ limit_screen_size();
+}
+
+/*
+ * Limit Rows and Columns to avoid an overflow in Rows * Columns.
+ */
+ void
+limit_screen_size()
+{
+ if (Columns < MIN_COLUMNS)
+ Columns = MIN_COLUMNS;
+ else if (Columns > 10000)
+ Columns = 10000;
+ if (Rows > 1000)
+ Rows = 1000;
}
/*
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1278,
/**/
1277,
/**/