Patch 7.4.1470
Problem: Coverity reports missing restore.
Solution: Move json_encode() call up.
Files: src/channel.c
*** ../vim-7.4.1469/src/channel.c 2016-03-02 20:48:43.835501284 +0100
--- src/channel.c 2016-03-02 21:07:24.391826045 +0100
***************
*** 1551,1572 ****
{
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)
{
ml_append(lnum, msg, 0, FALSE);
appended_lines_mark(lnum, 1L);
curbuf = save_curbuf;
--- 1551,1572 ----
{
if (buffer != NULL)
{
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;
*** ../vim-7.4.1469/src/version.c 2016-03-02 20:48:43.839501242 +0100
--- src/version.c 2016-03-02 21:08:44.458982581 +0100
***************
*** 745,746 ****
--- 745,748 ----
{ /* Add new patch number below this line */
+ /**/
+ 1470,
/**/
--
Why I like vim:
> I like VIM because, when I ask a question in this newsgroup, I get a
> one-line answer. With xemacs, I get a 1Kb lisp script with bugs in it ;-)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.