patch 9.0.0114: the command line takes up space even when not used

Problem:    The command line takes up space even when not used.
Solution:   Allow for 'cmdheight' to be set to zero. (Shougo Matsushita,
            closes #10675, closes #940)
diff --git a/src/drawscreen.c b/src/drawscreen.c
index d115704..578c66f 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -649,8 +649,8 @@
     int		off = 0;
     int		width;
 
-    // If 'ruler' off or redrawing disabled, don't do anything
-    if (!p_ru)
+    // If 'ruler' off or messages area disabled, don't do anything
+    if (!p_ru || (wp->w_status_height == 0 && p_ch == 0))
 	return;
 
     /*
@@ -671,7 +671,7 @@
 	return;
 
 #ifdef FEAT_STL_OPT
-    if (*p_ruf)
+    if (*p_ruf && p_ch > 0)
     {
 	int	called_emsg_before = called_emsg;
 
@@ -2506,7 +2506,8 @@
 	    // Past end of the window or end of the screen. Note that after
 	    // resizing wp->w_height may be end up too big. That's a problem
 	    // elsewhere, but prevent a crash here.
-	    if (row > wp->w_height || row + wp->w_winrow >= Rows)
+	    if (row > wp->w_height
+		    || row + wp->w_winrow >= (p_ch > 0 ? Rows : Rows + 1))
 	    {
 		// we may need the size of that too long line later on
 		if (dollar_vcol == -1)
@@ -2560,7 +2561,7 @@
 
 	// Safety check: if any of the wl_size values is wrong we might go over
 	// the end of w_lines[].
-	if (idx >= Rows)
+	if (idx >= (p_ch > 0 ? Rows : Rows + 1))
 	    break;
     }
 
@@ -2946,8 +2947,10 @@
     schar_T	*screenline2 = NULL;	// copy from ScreenLines2[]
 
     redraw_later(type);
-    if (msg_scrolled || (State != MODE_NORMAL && State != MODE_NORMAL_BUSY)
-								    || exiting)
+    if (msg_scrolled
+	    || (State != MODE_NORMAL && State != MODE_NORMAL_BUSY)
+	    || exiting
+	    || p_ch == 0)
 	return ret;
 
     // Allocate space to save the text displayed in the command line area.