summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index cb584f8b8..7aefdb58f 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