diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-04-06 20:45:43 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-04-06 20:45:43 +0200 |
commit | 4c7ab1bb5722de662db04550b74256671f20c4a2 (patch) | |
tree | 9fc51404bf8d87a9aa99df7ff30f18617f03513b /src/ex_cmds.c | |
parent | 75b8156a445fb4788dc3d1946764af30b5c50ac4 (diff) | |
download | vim-git-4c7ab1bb5722de662db04550b74256671f20c4a2.tar.gz |
updated for version 7.4.251v7.4.251
Problem: Crash when BufAdd autocommand wipes out the buffer.
Solution: Check for buffer to still be valid. Postpone freeing the buffer
structure. (Hirohito Higashi)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 7ae4917a8..ac30f2c01 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3343,6 +3343,12 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin) #endif buf = buflist_new(ffname, sfname, 0L, BLN_CURBUF | ((flags & ECMD_SET_HELP) ? 0 : BLN_LISTED)); +#ifdef FEAT_AUTOCMD + /* autocommands may change curwin and curbuf */ + if (oldwin != NULL) + oldwin = curwin; + old_curbuf = curbuf; +#endif } if (buf == NULL) goto theend; |