updated for version 7.2a-017
diff --git a/src/fileio.c b/src/fileio.c
index bbe97c9..d68adec 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -8235,7 +8235,7 @@
      */
     for (buf = firstbuf; buf != NULL; buf = buf->b_next)
     {
-	if (curbuf->b_ml.ml_mfp != NULL)
+	if (buf->b_ml.ml_mfp != NULL)
 	{
 	    /* find a window for this buffer and save some values */
 	    aucmd_prepbuf(&aco, buf);
diff --git a/src/version.c b/src/version.c
index 0e2c9ed..11abe51 100644
--- a/src/version.c
+++ b/src/version.c
@@ -677,6 +677,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    17,
+/**/
     16,
 /**/
     15,