]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.1054 v7.3.1054
authorBram Moolenaar <Bram@vim.org>
Thu, 30 May 2013 09:43:15 +0000 (11:43 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 30 May 2013 09:43:15 +0000 (11:43 +0200)
Problem:    Can't build without the +autocmd feature. (Elimar Riesebieter)
Solution:   Fix use of buf and curbuf.

src/ex_cmds.c
src/testdir/test86.ok
src/testdir/test87.ok
src/version.c

index cbdf91f3c4f9582d50c30d3f652a065d090adf2a..cd6772ed521225c06f676abd3339dd45939d738b 100644 (file)
@@ -2421,10 +2421,11 @@ rename_buffer(new_fname)
     char_u     *new_fname;
 {
     char_u     *fname, *sfname, *xfname;
-#ifdef FEAT_AUTOCMD
-    buf_T      *buf = curbuf;
+    buf_T      *buf;
 
-    apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, buf);
+#ifdef FEAT_AUTOCMD
+    buf = curbuf;
+    apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
     /* buffer changed, don't change name now */
     if (buf != curbuf)
        return FAIL;
@@ -2440,18 +2441,18 @@ rename_buffer(new_fname)
      * But don't set the alternate file name if the buffer didn't have a
      * name.
      */
-    fname = buf->b_ffname;
-    sfname = buf->b_sfname;
-    xfname = buf->b_fname;
-    buf->b_ffname = NULL;
-    buf->b_sfname = NULL;
-    if (setfname(buf, new_fname, NULL, TRUE) == FAIL)
-    {
-       buf->b_ffname = fname;
-       buf->b_sfname = sfname;
+    fname = curbuf->b_ffname;
+    sfname = curbuf->b_sfname;
+    xfname = curbuf->b_fname;
+    curbuf->b_ffname = NULL;
+    curbuf->b_sfname = NULL;
+    if (setfname(curbuf, new_fname, NULL, TRUE) == FAIL)
+    {
+       curbuf->b_ffname = fname;
+       curbuf->b_sfname = sfname;
        return FAIL;
     }
-    buf->b_flags |= BF_NOTEDITED;
+    curbuf->b_flags |= BF_NOTEDITED;
     if (xfname != NULL && *xfname != NUL)
     {
        buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
@@ -2461,7 +2462,7 @@ rename_buffer(new_fname)
     vim_free(fname);
     vim_free(sfname);
 #ifdef FEAT_AUTOCMD
-    apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, buf);
+    apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
 #endif
     /* Change directories when the 'acd' option is set. */
     DO_AUTOCHDIR
index f44ebf7c2670a3a4edbd05df113a104320815124..0b79b0dbf1d8b6c26ba4494676d1675aca3bca32 100644 (file)
@@ -320,13 +320,13 @@ Second line
 Third line
 foo
 1:BufFilePre:1
-6:BufFilePost:1
+1:BufFilePost:1
 testdir/foo
 5:BufFilePre:5
 5:BufFilePost:5
 testdir/bar
 1:BufFilePre:1
-7:BufFilePost:1
+1:BufFilePost:1
 testdir/test86.in
 valid: b:False, cb:True
 i:<buffer test86.in>
index 3b39c18ba880d39899f297ee74b98cd9f2ffb4af..3126fd36f7e56b1a34d3a5353e1aca125dac8961 100644 (file)
@@ -309,13 +309,13 @@ Second line
 Third line
 foo
 1:BufFilePre:1
-6:BufFilePost:1
+1:BufFilePost:1
 testdir/foo
 5:BufFilePre:5
 5:BufFilePost:5
 testdir/bar
 1:BufFilePre:1
-7:BufFilePost:1
+1:BufFilePost:1
 testdir/test87.in
 valid: b:False, cb:True
 i:<buffer test87.in>
index c7785bab0f787e0b9c8f5b95ea4f0858396fdf96..795e175bc8594bb5375aac8ea67a6bf4eedd7ce9 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1054,
 /**/
     1053,
 /**/