diff options
author | Bram Moolenaar <Bram@vim.org> | 2009-12-02 16:14:36 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2009-12-02 16:14:36 +0000 |
commit | d7834d306573ac35b5c208554b23cc027fa01404 (patch) | |
tree | bfab0c625448a4be41e8fc07e154234fcc310a0e /src/misc1.c | |
parent | 243973325e2b44a3c13234d11138a5b451794fd3 (diff) | |
download | vim-git-d7834d306573ac35b5c208554b23cc027fa01404.tar.gz |
updated for version 7.2-313v7.2.313
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c index aa9021507..7da8701cb 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -8447,6 +8447,46 @@ fast_breakcheck() } /* + * Invoke expand_wildcards() for one pattern. + * Expand items like "%:h" before the expansion. + * Returns OK or FAIL. + */ + int +expand_wildcards_eval(pat, num_file, file, flags) + char_u **pat; /* pointer to input pattern */ + int *num_file; /* resulting number of files */ + char_u ***file; /* array of resulting files */ + int flags; /* EW_DIR, etc. */ +{ + int ret = FAIL; + char_u *eval_pat = NULL; + char_u *exp_pat = *pat; + char_u *ignored_msg; + int usedlen; + + if (*exp_pat == '%' || *exp_pat == '#' || *exp_pat == '<') + { + ++emsg_off; + eval_pat = eval_vars(exp_pat, exp_pat, &usedlen, + NULL, &ignored_msg, NULL); + --emsg_off; + if (eval_pat != NULL) + exp_pat = concat_str(eval_pat, exp_pat + usedlen); + } + + if (exp_pat != NULL) + ret = expand_wildcards(1, &exp_pat, num_file, file, flags); + + if (eval_pat != NULL) + { + vim_free(exp_pat); + vim_free(eval_pat); + } + + return ret; +} + +/* * Expand wildcards. Calls gen_expand_wildcards() and removes files matching * 'wildignore'. * Returns OK or FAIL. |