]> granicus.if.org Git - vim/commitdiff
updated for version 7.2-313 v7.2.313
authorBram Moolenaar <Bram@vim.org>
Wed, 2 Dec 2009 16:14:36 +0000 (16:14 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 2 Dec 2009 16:14:36 +0000 (16:14 +0000)
src/ex_getln.c
src/misc1.c
src/proto/misc1.pro
src/version.c

index 153712887e90aabc7d6964e727169a2913e217e6..08a7855e613d0862808aaa8227a886729e2504f6 100644 (file)
@@ -4422,7 +4422,8 @@ ExpandFromContext(xp, pat, num_file, file, options)
            flags |= EW_FILE;
        else
            flags = (flags | EW_DIR) & ~EW_FILE;
-       ret = expand_wildcards(1, &pat, num_file, file, flags);
+       /* Expand wildcards, supporting %:h and the like. */
+       ret = expand_wildcards_eval(&pat, num_file, file, flags);
        if (free_pat)
            vim_free(pat);
        return ret;
index aa90215079da367863d50a90dc3cbcc2bc9bb181..7da8701cbad9fef93e4efe0441d962b196f1c01a 100644 (file)
@@ -8446,6 +8446,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'.
index a54b8b5695befe8ec5c990527134e39657ed638f..a036e3ea2245438755e1d651af47da8ec94d567a 100644 (file)
@@ -85,6 +85,7 @@ void preserve_exit __ARGS((void));
 int vim_fexists __ARGS((char_u *fname));
 void line_breakcheck __ARGS((void));
 void fast_breakcheck __ARGS((void));
+int expand_wildcards_eval __ARGS((char_u **pat, int *num_file, char_u ***file, int flags));
 int expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
 int match_suffix __ARGS((char_u *fname));
 int unix_expandpath __ARGS((garray_T *gap, char_u *path, int wildoff, int flags, int didstar));
index 524965eb78edf703f78e6b58fd0719ba5478c75e..80aeaa3dbb44f873ab9b2044c60eccaa71287360 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    313,
 /**/
     312,
 /**/