diff src/ex_cmds.c @ 5802:80421d934ebd v7.4.245

updated for version 7.4.245 Problem: Crash for "vim -u NONE -N -c '&&'". Solution: Check for the pattern to be NULL. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Fri, 04 Apr 2014 19:00:48 +0200
parents 845608965bd9
children 29eb4c2a33ac
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4425,7 +4425,7 @@ do_sub(eap)
      * TODO: find a generic solution to make line-joining operations more
      * efficient, avoid allocating a string that grows in size.
      */
-    if (STRCMP(pat, "\\n") == 0 && STRLEN(pat) == 2
+    if (pat != NULL && STRCMP(pat, "\\n") == 0
 	    && *sub == NUL
 	    && (*cmd == NUL || (cmd[1] == NUL && (*cmd == 'g' || *cmd == 'l'
 					     || *cmd == 'p' || *cmd == '#'))))