diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index ad46c19fb078467603a5a0145c49b78cc51525d8..f373806ec8ab74683d35db672ea9b89b171a5c41 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -736,7 +736,7 @@ notags:
 
 clean:
 	- if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
-	- if exist auto/nul $(DEL_TREE) auto
+	- if exist auto/pathdef.c del auto/pathdef.c
 	- if exist *.obj del *.obj
 	- if exist $(VIM).exe del $(VIM).exe
 	- if exist $(VIM).ilk del $(VIM).ilk
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 4e430c7bc64b30c9d68a51edc0337ad23cbf7d95..798262d1965df050855f1d8197c12cd161ec9e78 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9729,7 +9729,10 @@ put_view(fd, wp, add_edit, flagp)
      */
     if ((*flagp & SSOP_FOLDS)
 	    && wp->w_buffer->b_ffname != NULL
-	    && (*wp->w_buffer->b_p_bt == NUL || wp->w_buffer->b_help))
+# ifdef FEAT_QUICKFIX
+	    && (*wp->w_buffer->b_p_bt == NUL || wp->w_buffer->b_help)
+# endif
+	    )
     {
 	if (put_folds(fd, wp) == FAIL)
 	    return FAIL;
diff --git a/src/fileio.c b/src/fileio.c
index ce3e2a043d85a470d11fbc6ada7e875fbc8024b5..868b649891d9bcc7bfbf2dbcc03486b8ccd185b3 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2882,9 +2882,11 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 	    if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEAPPENDCMD,
 					 sfname, sfname, FALSE, curbuf, eap)))
 	    {
+#ifdef FEAT_QUICKFIX
 		if (overwriting && bt_nofile(curbuf))
 		    nofile_err = TRUE;
 		else
+#endif
 		    apply_autocmds_exarg(EVENT_FILEAPPENDPRE,
 					  sfname, sfname, FALSE, curbuf, eap);
 	    }
@@ -2899,9 +2901,11 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 	    if (!(did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
 					 sfname, sfname, FALSE, curbuf, eap)))
 	    {
+#ifdef FEAT_QUICKFIX
 		if (overwriting && bt_nofile(curbuf))
 		    nofile_err = TRUE;
 		else
+#endif
 		    apply_autocmds_exarg(EVENT_BUFWRITEPRE,
 					  sfname, sfname, FALSE, curbuf, eap);
 	    }
@@ -2911,9 +2915,11 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 	    if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEWRITECMD,
 					 sfname, sfname, FALSE, curbuf, eap)))
 	    {
+#ifdef FEAT_QUICKFIX
 		if (overwriting && bt_nofile(curbuf))
 		    nofile_err = TRUE;
 		else
+#endif
 		    apply_autocmds_exarg(EVENT_FILEWRITEPRE,
 					  sfname, sfname, FALSE, curbuf, eap);
 	    }
diff --git a/src/gui_w16.c b/src/gui_w16.c
index 2452ce360b5a352a2395a128d237388791ab4353..b8e8ca9495b40a6e5d4fd375d0fc6a4372207d75 100644
--- a/src/gui_w16.c
+++ b/src/gui_w16.c
@@ -764,6 +764,22 @@ clear_rect(RECT *rcp)
 }
 
 
+    void
+gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
+{
+
+    *screen_w = GetSystemMetrics(SM_CXFULLSCREEN)
+	      - GetSystemMetrics(SM_CXFRAME) * 2;
+    /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
+     * the menubar for MSwin, we subtract it from the screen height, so that
+     * the window size can be made to fit on the screen. */
+    *screen_h = GetSystemMetrics(SM_CYFULLSCREEN)
+	      - GetSystemMetrics(SM_CYFRAME) * 2
+#ifdef FEAT_MENU
+	      - gui_mswin_get_menu_height(FALSE)
+#endif
+	      ;
+}
 
 
 #if defined(FEAT_MENU) || defined(PROTO)
diff --git a/src/gui_w48.c b/src/gui_w48.c
index 03b7d71750b7c17691a7268714fe49fb7d93dad6..3aa028ee4b97db24c7649236bb0e6c4685866a56 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -2477,23 +2477,6 @@ gui_mswin_get_valid_dimensions(
 		    ((h - base_height) / gui.char_height) * gui.char_height;
 }
 
-    void
-gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
-{
-
-    *screen_w = GetSystemMetrics(SM_CXFULLSCREEN)
-	      - GetSystemMetrics(SM_CXFRAME) * 2;
-    /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
-     * the menubar for MSwin, we subtract it from the screen height, so that
-     * the window size can be made to fit on the screen. */
-    *screen_h = GetSystemMetrics(SM_CYFULLSCREEN)
-	      - GetSystemMetrics(SM_CYFRAME) * 2
-#ifdef FEAT_MENU
-	      - gui_mswin_get_menu_height(FALSE)
-#endif
-	      ;
-}
-
     void
 gui_mch_flash(int msec)
 {
diff --git a/src/window.c b/src/window.c
index a021805941cc61251a971fec258566c6817ba67c..bb2647cff420095182c17673b7fab4b0bdc9a85f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -121,6 +121,12 @@ do_window(nchar, Prenum, xchar)
 #ifdef FEAT_VISUAL
 		reset_VIsual_and_resel();	/* stop Visual mode */
 #endif
+#ifdef FEAT_QUICKFIX
+		/* When splitting the quickfix window open a new buffer in it,
+		 * don't replicate the quickfix buffer. */
+		if (bt_quickfix(curbuf))
+		    goto newwindow;
+#endif
 #ifdef FEAT_GUI
 		need_mouse_correct = TRUE;
 #endif
@@ -161,6 +167,9 @@ do_window(nchar, Prenum, xchar)
 		CHECK_CMDWIN
 #ifdef FEAT_VISUAL
 		reset_VIsual_and_resel();	/* stop Visual mode */
+#endif
+#ifdef FEAT_QUICKFIX
+newwindow:
 #endif
 		if (Prenum)
 		    sprintf((char *)cbuf, "%ld", Prenum); /* window height */