summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 10c8e617c9..14045267da 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4975,6 +4975,8 @@ ex_global(exarg_T *eap)
// a match on this line?
match = vim_regexec_multi(&regmatch, curwin, curbuf, lnum,
(colnr_T)0, NULL, NULL);
+ if (regmatch.regprog == NULL)
+ break; // re-compiling regprog failed
if ((type == 'g' && match) || (type == 'v' && !match))
{
ml_setmarked(lnum);