From: Bram Moolenaar Date: Tue, 28 Jan 2020 22:13:42 +0000 (+0100) Subject: patch 8.2.0172: Coverity warning for not restoring character X-Git-Tag: v8.2.0172 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4549ece47cc8d6487d8e64ae37361fea87e3ad39;p=thirdparty%2Fvim.git patch 8.2.0172: Coverity warning for not restoring character Problem: Coverity warning for not restoring character. Solution: Restore the character also in case of failure. --- diff --git a/src/version.c b/src/version.c index f82670c9e5..936f9b5151 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 172, /**/ 171, /**/ diff --git a/src/vim9script.c b/src/vim9script.c index 9aa33d0ab8..b73b592a29 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);