]> granicus.if.org Git - vim/commitdiff
patch 8.2.4910: imperfect coding v8.2.4910
authorBram Moolenaar <Bram@vim.org>
Sat, 7 May 2022 16:45:16 +0000 (17:45 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 7 May 2022 16:45:16 +0000 (17:45 +0100)
Problem:    Imperfect coding.
Solution:   Make code nicer.

src/ex_getln.c
src/version.c

index 09f28428334ac391ffc7fce6ab3a50de3cde3cc1..7f02b889841a983308df39fe23c575f19c43c7a5 100644 (file)
@@ -4130,7 +4130,7 @@ get_cmdline_completion(void)
        return NULL;
 
     p = get_ccline_ptr();
-    if (p && p->xpc != NULL)
+    if (p != NULL && p->xpc != NULL)
     {
        char_u *cmd_compl;
 
@@ -4138,7 +4138,7 @@ get_cmdline_completion(void)
 
        cmd_compl = cmdcomplete_type_to_str(p->xpc->xp_context);
        if (cmd_compl != NULL)
-           return vim_strnsave(cmd_compl, strlen((char *)cmd_compl));
+           return vim_strsave(cmd_compl);
     }
 
     return NULL;
index 79e89aa623d689eb83c32d4b855fa5a6d78c7770..4a4c7a9fc578793a43deee7ebe6bdc1fd414cd0f 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4910,
 /**/
     4909,
 /**/