summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-28 23:13:42 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-28 23:13:42 +0100
commit4549ece47cc8d6487d8e64ae37361fea87e3ad39 (patch)
tree40d3520766250651ba9e28ee843c52c27893545f
parent9a5e5a3e33bb86ba5209278e83ec60790f80d15c (diff)
downloadvim-git-4549ece47cc8d6487d8e64ae37361fea87e3ad39.tar.gz
patch 8.2.0172: Coverity warning for not restoring characterv8.2.0172
Problem: Coverity warning for not restoring character. Solution: Restore the character also in case of failure.
-rw-r--r--src/version.c2
-rw-r--r--src/vim9script.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/version.c b/src/version.c
index f82670c9e..936f9b515 100644
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 172,
+/**/
171,
/**/
170,
diff --git a/src/vim9script.c b/src/vim9script.c
index 9aa33d0ab..b73b592a2 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -358,15 +358,14 @@ handle_import(char_u *arg_start, garray_T *gap, int import_sid)
}
sv = NULL;
}
+ *arg = cc;
+ arg = skipwhite(arg);
imported = new_imported(gap != NULL ? gap
: &SCRIPT_ITEM(import_sid)->sn_imports);
if (imported == NULL)
return NULL;
- *arg = cc;
- arg = skipwhite(arg);
-
// TODO: check for "as" following
// imported->imp_name = vim_strnsave(as_ptr, as_len);
imported->imp_name = vim_strnsave(name, name_len);