Skip to content

Commit f7b8609

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.1.0717: Unnecessary nextcmd NULL checks in parse_command_modifiers()
Problem: Unnecessary nextcmd NULL checks in parse_command_modifiers(). Solution: Remove them (zeertzjq) Every place parse_command_modifiers() is called, nextcmd is NULL, and after it's set to non-NULL the function returns very soon. Even if one day nextcmd may be non-NULL, the NULL checks may still be wrong as the correct behavior may be overriding nextcmd. closes: #15620 Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 233252f commit f7b8609

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/ex_docmd.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,12 +2898,9 @@ parse_command_modifiers(
28982898
if (comment_start(eap->cmd, starts_with_colon))
28992899
{
29002900
// a comment ends at a NL
2901-
if (eap->nextcmd == NULL)
2902-
{
2903-
eap->nextcmd = vim_strchr(eap->cmd, '\n');
2904-
if (eap->nextcmd != NULL)
2905-
++eap->nextcmd;
2906-
}
2901+
eap->nextcmd = vim_strchr(eap->cmd, '\n');
2902+
if (eap->nextcmd != NULL)
2903+
++eap->nextcmd;
29072904
if (vim9script)
29082905
{
29092906
if (has_cmdmod(cmod, FALSE))
@@ -2916,7 +2913,7 @@ parse_command_modifiers(
29162913
}
29172914
return FAIL;
29182915
}
2919-
if (eap->nextcmd == NULL && *eap->cmd == '\n')
2916+
if (*eap->cmd == '\n')
29202917
{
29212918
eap->nextcmd = eap->cmd + 1;
29222919
return FAIL;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
717,
707709
/**/
708710
716,
709711
/**/

0 commit comments

Comments
 (0)