summaryrefslogtreecommitdiff
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-10 15:15:37 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-10 15:15:37 +0100
commit03c60c1573cdbebbb662863cfc1780d19d511db5 (patch)
tree15d54d07bbb9de9a678b8f5beabc9ed042c5d680 /src/channel.c
parentf446b48ff0bffae2b453cd4f9e3c25dfe363d29d (diff)
downloadvim-git-03c60c1573cdbebbb662863cfc1780d19d511db5.tar.gz
patch 8.0.0166: JSON with a duplicate key gives an internal errorv8.0.0166
Problem: JSON with a duplicate key gives an internal error. (Lcd) Solution: Give a normal error. Avoid an error when parsing JSON from a remote client fails.
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/channel.c b/src/channel.c
index f409e1d20..f522e80c4 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1896,9 +1896,12 @@ channel_parse_json(channel_T *channel, ch_part_T part)
/* When a message is incomplete we wait for a short while for more to
* arrive. After the delay drop the input, otherwise a truncated string
- * or list will make us hang. */
+ * or list will make us hang.
+ * Do not generate error messages, they will be written in a channel log. */
+ ++emsg_silent;
status = json_decode(&reader, &listtv,
chanpart->ch_mode == MODE_JS ? JSON_JS : 0);
+ --emsg_silent;
if (status == OK)
{
/* Only accept the response when it is a list with at least two