glob2regpat(): handle empty string.

This commit is contained in:
Justin M. Keyes
2016-01-27 03:26:13 -05:00
parent 765d394f18
commit 894fcb778e
3 changed files with 5 additions and 1 deletions

View File

@@ -10792,7 +10792,7 @@ static void f_glob2regpat(typval_T *argvars, typval_T *rettv)
char_u *pat = get_tv_string_chk(&argvars[0]); // NULL on type error
rettv->v_type = VAR_STRING;
rettv->vval.v_string = (pat == NULL)
rettv->vval.v_string = (pat == NULL || *pat == NUL)
? NULL
: file_pat_to_reg_pat(pat, NULL, NULL, false);
}