diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-03-20 17:36:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-03-20 17:36:42 +0100 |
commit | 825e7ab423ce34a57f4819cc3745246246f38081 (patch) | |
tree | ef01562969878273d7f7a1783895516a37599b1a /src | |
parent | fbc25b20cbf29d6f9846e97875474f18e8d0c7be (diff) |
updated for version 7.4.668v7.4.668
Problem: Can't use a glob pattern as a regexp pattern.
Solution: Add glob2regpat(). (Christian Brabandt)
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 16 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index cb584f8b8e..7aefdb58fd 100644 --- a/src/eval.c +++ b/src/eval.c @@ -575,6 +575,7 @@ static void f_getwinposy __ARGS((typval_T *argvars, typval_T *rettv)); static void f_getwinvar __ARGS((typval_T *argvars, typval_T *rettv)); static void f_glob __ARGS((typval_T *argvars, typval_T *rettv)); static void f_globpath __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_glob2regpat __ARGS((typval_T *argvars, typval_T *rettv)); static void f_has __ARGS((typval_T *argvars, typval_T *rettv)); static void f_has_key __ARGS((typval_T *argvars, typval_T *rettv)); static void f_haslocaldir __ARGS((typval_T *argvars, typval_T *rettv)); @@ -8142,6 +8143,7 @@ static struct fst {"getwinposy", 0, 0, f_getwinposy}, {"getwinvar", 2, 3, f_getwinvar}, {"glob", 1, 4, f_glob}, + {"glob2regpat", 1, 1, f_glob2regpat}, {"globpath", 2, 5, f_globpath}, {"has", 1, 1, f_has}, {"has_key", 2, 2, f_has_key}, @@ -12500,6 +12502,20 @@ f_globpath(argvars, rettv) } /* + * "glob2regpat()" function + */ + static void +f_glob2regpat(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ + char_u *pat = get_tv_string_chk(&argvars[0]); + + rettv->v_type = VAR_STRING; + rettv->vval.v_string = file_pat_to_reg_pat(pat, NULL, NULL, FALSE); +} + +/* * "has()" function */ static void diff --git a/src/version.c b/src/version.c index c721e0784c..c5e8a152a8 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 668, +/**/ 667, /**/ 666, |