diff options
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 5d23893be4..b56b9f8867 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3661,8 +3661,8 @@ void do_sub(exarg_T *eap) // more efficient. // TODO: find a generic solution to make line-joining operations more // efficient, avoid allocating a string that grows in size. - if (strcmp((const char *)pat, "\\n") == 0 - && strlen((const char *)pat) == 2 + if (pat != NULL + && strcmp((const char *)pat, "\\n") == 0 && *sub == NUL && (*cmd == NUL || (cmd[1] == NUL && (*cmd == 'g' |