diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-02 21:09:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-02 21:09:32 +0100 |
commit | 289a90551d185c307abd4cfe6baadea8990d956b (patch) | |
tree | dba172d04172e936ef801074213bedf1fb5518b6 | |
parent | 42bc6dde46f1b52476cc84ee89277f981b4116c4 (diff) | |
download | vim-git-289a90551d185c307abd4cfe6baadea8990d956b.tar.gz |
patch 7.4.1470v7.4.1470
Problem: Coverity reports missing restore.
Solution: Move json_encode() call up.
-rw-r--r-- | src/channel.c | 22 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/channel.c b/src/channel.c index 08271ed80..824da8a7d 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1551,22 +1551,22 @@ may_invoke_callback(channel_T *channel, int part) { if (buffer != NULL) { - buf_T *save_curbuf = curbuf; - linenr_T lnum = buffer->b_ml.ml_line_count; - - /* Append to the buffer */ - ch_logn(channel, "appending line %d to buffer", (int)lnum + 1); - - curbuf = buffer; - u_sync(TRUE); - /* ignore undo failure, undo is not very useful here */ - ignored = u_save(lnum, lnum + 1); - if (msg == NULL) /* JSON or JS mode: re-encode the message. */ msg = json_encode(listtv, ch_mode); if (msg != NULL) { + buf_T *save_curbuf = curbuf; + linenr_T lnum = buffer->b_ml.ml_line_count; + + /* Append to the buffer */ + ch_logn(channel, "appending line %d to buffer", (int)lnum + 1); + + curbuf = buffer; + u_sync(TRUE); + /* ignore undo failure, undo is not very useful here */ + ignored = u_save(lnum, lnum + 1); + ml_append(lnum, msg, 0, FALSE); appended_lines_mark(lnum, 1L); curbuf = save_curbuf; diff --git a/src/version.c b/src/version.c index eef7eebc1..66a86fb63 100644 --- a/src/version.c +++ b/src/version.c @@ -744,6 +744,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1470, +/**/ 1469, /**/ 1468, |