Karsten Hopp 1c124b
To: vim_dev@googlegroups.com
Karsten Hopp 1c124b
Subject: Patch 7.3.1054
Karsten Hopp 1c124b
Fcc: outbox
Karsten Hopp 1c124b
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 1c124b
Mime-Version: 1.0
Karsten Hopp 1c124b
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 1c124b
Content-Transfer-Encoding: 8bit
Karsten Hopp 1c124b
------------
Karsten Hopp 1c124b
Karsten Hopp 1c124b
Patch 7.3.1054 (after 7.3.1042)
Karsten Hopp 1c124b
Problem:    Can't build without the +autocmd feature. (Elimar Riesebieter)
Karsten Hopp 1c124b
Solution:   Fix use of buf and curbuf.
Karsten Hopp 1c124b
Files:      src/ex_cmds.c, src/testdir/test86.ok, src/testdir/test87.ok
Karsten Hopp 1c124b
Karsten Hopp 1c124b
Karsten Hopp 1c124b
*** ../vim-7.3.1053/src/ex_cmds.c	2013-05-29 22:02:18.000000000 +0200
Karsten Hopp 1c124b
--- src/ex_cmds.c	2013-05-30 11:24:41.000000000 +0200
Karsten Hopp 1c124b
***************
Karsten Hopp 1c124b
*** 2421,2430 ****
Karsten Hopp 1c124b
      char_u	*new_fname;
Karsten Hopp 1c124b
  {
Karsten Hopp 1c124b
      char_u	*fname, *sfname, *xfname;
Karsten Hopp 1c124b
! #ifdef FEAT_AUTOCMD
Karsten Hopp 1c124b
!     buf_T	*buf = curbuf;
Karsten Hopp 1c124b
  
Karsten Hopp 1c124b
!     apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, buf);
Karsten Hopp 1c124b
      /* buffer changed, don't change name now */
Karsten Hopp 1c124b
      if (buf != curbuf)
Karsten Hopp 1c124b
  	return FAIL;
Karsten Hopp 1c124b
--- 2421,2431 ----
Karsten Hopp 1c124b
      char_u	*new_fname;
Karsten Hopp 1c124b
  {
Karsten Hopp 1c124b
      char_u	*fname, *sfname, *xfname;
Karsten Hopp 1c124b
!     buf_T	*buf;
Karsten Hopp 1c124b
  
Karsten Hopp 1c124b
! #ifdef FEAT_AUTOCMD
Karsten Hopp 1c124b
!     buf = curbuf;
Karsten Hopp 1c124b
!     apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
Karsten Hopp 1c124b
      /* buffer changed, don't change name now */
Karsten Hopp 1c124b
      if (buf != curbuf)
Karsten Hopp 1c124b
  	return FAIL;
Karsten Hopp 1c124b
***************
Karsten Hopp 1c124b
*** 2440,2457 ****
Karsten Hopp 1c124b
       * But don't set the alternate file name if the buffer didn't have a
Karsten Hopp 1c124b
       * name.
Karsten Hopp 1c124b
       */
Karsten Hopp 1c124b
!     fname = buf->b_ffname;
Karsten Hopp 1c124b
!     sfname = buf->b_sfname;
Karsten Hopp 1c124b
!     xfname = buf->b_fname;
Karsten Hopp 1c124b
!     buf->b_ffname = NULL;
Karsten Hopp 1c124b
!     buf->b_sfname = NULL;
Karsten Hopp 1c124b
!     if (setfname(buf, new_fname, NULL, TRUE) == FAIL)
Karsten Hopp 1c124b
      {
Karsten Hopp 1c124b
! 	buf->b_ffname = fname;
Karsten Hopp 1c124b
! 	buf->b_sfname = sfname;
Karsten Hopp 1c124b
  	return FAIL;
Karsten Hopp 1c124b
      }
Karsten Hopp 1c124b
!     buf->b_flags |= BF_NOTEDITED;
Karsten Hopp 1c124b
      if (xfname != NULL && *xfname != NUL)
Karsten Hopp 1c124b
      {
Karsten Hopp 1c124b
  	buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
Karsten Hopp 1c124b
--- 2441,2458 ----
Karsten Hopp 1c124b
       * But don't set the alternate file name if the buffer didn't have a
Karsten Hopp 1c124b
       * name.
Karsten Hopp 1c124b
       */
Karsten Hopp 1c124b
!     fname = curbuf->b_ffname;
Karsten Hopp 1c124b
!     sfname = curbuf->b_sfname;
Karsten Hopp 1c124b
!     xfname = curbuf->b_fname;
Karsten Hopp 1c124b
!     curbuf->b_ffname = NULL;
Karsten Hopp 1c124b
!     curbuf->b_sfname = NULL;
Karsten Hopp 1c124b
!     if (setfname(curbuf, new_fname, NULL, TRUE) == FAIL)
Karsten Hopp 1c124b
      {
Karsten Hopp 1c124b
! 	curbuf->b_ffname = fname;
Karsten Hopp 1c124b
! 	curbuf->b_sfname = sfname;
Karsten Hopp 1c124b
  	return FAIL;
Karsten Hopp 1c124b
      }
Karsten Hopp 1c124b
!     curbuf->b_flags |= BF_NOTEDITED;
Karsten Hopp 1c124b
      if (xfname != NULL && *xfname != NUL)
Karsten Hopp 1c124b
      {
Karsten Hopp 1c124b
  	buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
Karsten Hopp 1c124b
***************
Karsten Hopp 1c124b
*** 2461,2467 ****
Karsten Hopp 1c124b
      vim_free(fname);
Karsten Hopp 1c124b
      vim_free(sfname);
Karsten Hopp 1c124b
  #ifdef FEAT_AUTOCMD
Karsten Hopp 1c124b
!     apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, buf);
Karsten Hopp 1c124b
  #endif
Karsten Hopp 1c124b
      /* Change directories when the 'acd' option is set. */
Karsten Hopp 1c124b
      DO_AUTOCHDIR
Karsten Hopp 1c124b
--- 2462,2468 ----
Karsten Hopp 1c124b
      vim_free(fname);
Karsten Hopp 1c124b
      vim_free(sfname);
Karsten Hopp 1c124b
  #ifdef FEAT_AUTOCMD
Karsten Hopp 1c124b
!     apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
Karsten Hopp 1c124b
  #endif
Karsten Hopp 1c124b
      /* Change directories when the 'acd' option is set. */
Karsten Hopp 1c124b
      DO_AUTOCHDIR
Karsten Hopp 1c124b
*** ../vim-7.3.1053/src/testdir/test86.ok	2013-05-29 22:36:06.000000000 +0200
Karsten Hopp 1c124b
--- src/testdir/test86.ok	2013-05-30 11:34:12.000000000 +0200
Karsten Hopp 1c124b
***************
Karsten Hopp 1c124b
*** 320,332 ****
Karsten Hopp 1c124b
  Third line
Karsten Hopp 1c124b
  foo
Karsten Hopp 1c124b
  1:BufFilePre:1
Karsten Hopp 1c124b
! 6:BufFilePost:1
Karsten Hopp 1c124b
  testdir/foo
Karsten Hopp 1c124b
  5:BufFilePre:5
Karsten Hopp 1c124b
  5:BufFilePost:5
Karsten Hopp 1c124b
  testdir/bar
Karsten Hopp 1c124b
  1:BufFilePre:1
Karsten Hopp 1c124b
! 7:BufFilePost:1
Karsten Hopp 1c124b
  testdir/test86.in
Karsten Hopp 1c124b
  valid: b:False, cb:True
Karsten Hopp 1c124b
  i:<buffer test86.in>
Karsten Hopp 1c124b
--- 320,332 ----
Karsten Hopp 1c124b
  Third line
Karsten Hopp 1c124b
  foo
Karsten Hopp 1c124b
  1:BufFilePre:1
Karsten Hopp 1c124b
! 1:BufFilePost:1
Karsten Hopp 1c124b
  testdir/foo
Karsten Hopp 1c124b
  5:BufFilePre:5
Karsten Hopp 1c124b
  5:BufFilePost:5
Karsten Hopp 1c124b
  testdir/bar
Karsten Hopp 1c124b
  1:BufFilePre:1
Karsten Hopp 1c124b
! 1:BufFilePost:1
Karsten Hopp 1c124b
  testdir/test86.in
Karsten Hopp 1c124b
  valid: b:False, cb:True
Karsten Hopp 1c124b
  i:<buffer test86.in>
Karsten Hopp 1c124b
*** ../vim-7.3.1053/src/testdir/test87.ok	2013-05-29 22:36:06.000000000 +0200
Karsten Hopp 1c124b
--- src/testdir/test87.ok	2013-05-30 11:34:26.000000000 +0200
Karsten Hopp 1c124b
***************
Karsten Hopp 1c124b
*** 309,321 ****
Karsten Hopp 1c124b
  Third line
Karsten Hopp 1c124b
  foo
Karsten Hopp 1c124b
  1:BufFilePre:1
Karsten Hopp 1c124b
! 6:BufFilePost:1
Karsten Hopp 1c124b
  testdir/foo
Karsten Hopp 1c124b
  5:BufFilePre:5
Karsten Hopp 1c124b
  5:BufFilePost:5
Karsten Hopp 1c124b
  testdir/bar
Karsten Hopp 1c124b
  1:BufFilePre:1
Karsten Hopp 1c124b
! 7:BufFilePost:1
Karsten Hopp 1c124b
  testdir/test87.in
Karsten Hopp 1c124b
  valid: b:False, cb:True
Karsten Hopp 1c124b
  i:<buffer test87.in>
Karsten Hopp 1c124b
--- 309,321 ----
Karsten Hopp 1c124b
  Third line
Karsten Hopp 1c124b
  foo
Karsten Hopp 1c124b
  1:BufFilePre:1
Karsten Hopp 1c124b
! 1:BufFilePost:1
Karsten Hopp 1c124b
  testdir/foo
Karsten Hopp 1c124b
  5:BufFilePre:5
Karsten Hopp 1c124b
  5:BufFilePost:5
Karsten Hopp 1c124b
  testdir/bar
Karsten Hopp 1c124b
  1:BufFilePre:1
Karsten Hopp 1c124b
! 1:BufFilePost:1
Karsten Hopp 1c124b
  testdir/test87.in
Karsten Hopp 1c124b
  valid: b:False, cb:True
Karsten Hopp 1c124b
  i:<buffer test87.in>
Karsten Hopp 1c124b
*** ../vim-7.3.1053/src/version.c	2013-05-29 22:58:28.000000000 +0200
Karsten Hopp 1c124b
--- src/version.c	2013-05-30 11:40:54.000000000 +0200
Karsten Hopp 1c124b
***************
Karsten Hopp 1c124b
*** 730,731 ****
Karsten Hopp 1c124b
--- 730,733 ----
Karsten Hopp 1c124b
  {   /* Add new patch number below this line */
Karsten Hopp 1c124b
+ /**/
Karsten Hopp 1c124b
+     1054,
Karsten Hopp 1c124b
  /**/
Karsten Hopp 1c124b
Karsten Hopp 1c124b
-- 
Karsten Hopp 1c124b
For a moment, nothing happened.
Karsten Hopp 1c124b
Then, after a second or so, nothing continued to happen.
Karsten Hopp 1c124b
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
Karsten Hopp 1c124b
Karsten Hopp 1c124b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 1c124b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 1c124b
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 1c124b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///