diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-02-19 02:38:42 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-02-19 02:38:42 -0500 |
commit | 12938b82fb82ab4c458f8fa5e631f4379f53894d (patch) | |
tree | 5101d567fa456715a14f75f2733876342d0e0c82 /src/nvim/buffer.c | |
parent | 91254bd9d8a849463b63e6d07569157e2491c98e (diff) | |
parent | 156df2c81b7bc79a4a665bdaa017ccfb2b565304 (diff) | |
download | rneovim-12938b82fb82ab4c458f8fa5e631f4379f53894d.tar.gz rneovim-12938b82fb82ab4c458f8fa5e631f4379f53894d.tar.bz2 rneovim-12938b82fb82ab4c458f8fa5e631f4379f53894d.zip |
Merge pull request #4294 from justinmk/coverity
coverity
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 9806623433..c05090bbf6 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1741,12 +1741,15 @@ int buflist_findpat( int toggledollar; if (pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#')) { - if (*pattern == '%') + if (*pattern == '%') { match = curbuf->b_fnum; - else + } else { match = curwin->w_alt_fnum; - if (diffmode && !diff_mode_buf(buflist_findnr(match))) + } + buf_T *found_buf = buflist_findnr(match); + if (diffmode && !(found_buf && diff_mode_buf(found_buf))) { match = -1; + } } /* * Try four ways of matching a listed buffer: |