]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0172: Coverity warning for not restoring character v8.2.0172
authorBram Moolenaar <Bram@vim.org>
Tue, 28 Jan 2020 22:13:42 +0000 (23:13 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 28 Jan 2020 22:13:42 +0000 (23:13 +0100)
Problem:    Coverity warning for not restoring character.
Solution:   Restore the character also in case of failure.

src/version.c
src/vim9script.c

index f82670c9e561a8d8ef1a8c86f0f961576de730ac..936f9b5151fbd145cee2b65c64c5a8da15657e8c 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    172,
 /**/
     171,
 /**/
index 9aa33d0ab8adf230aae8bc7cee3afc53e8172ad2..b73b592a29d1e9f2c1377239ea0c3d439d22ae0c 100644 (file)
@@ -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);