diff options
-rw-r--r-- | src/misc1.c | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/misc1.c b/src/misc1.c index a5a3ad314..1cd7cceee 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -9103,15 +9103,15 @@ dos_expandpath( } /* compile the regexp into a program */ - if (flags & EW_NOERROR) + if (flags & (EW_NOERROR | EW_NOTWILD)) ++emsg_silent; regmatch.rm_ic = TRUE; /* Always ignore case */ regmatch.regprog = vim_regcomp(pat, RE_MAGIC); - if (flags & EW_NOERROR) + if (flags & (EW_NOERROR | EW_NOTWILD)) --emsg_silent; vim_free(pat); - if (regmatch.regprog == NULL) + if (regmatch.regprog == NULL && (flags & EW_NOTWILD) == 0) { vim_free(buf); return 0; @@ -9179,7 +9179,8 @@ dos_expandpath( * all entries found with "matchname". */ if ((p[0] != '.' || starts_with_dot) && (matchname == NULL - || vim_regexec(®match, p, (colnr_T)0) + || (regmatch.regprog != NULL + && vim_regexec(®match, p, (colnr_T)0)) || ((flags & EW_NOTWILD) && fnamencmp(path + (s - buf), p, e - s) == 0))) { @@ -9419,10 +9420,14 @@ unix_expandpath(gap, path, wildoff, flags, didstar) else regmatch.rm_ic = FALSE; /* Don't ignore case */ #endif + if (flags & (EW_NOERROR | EW_NOTWILD)) + ++emsg_silent; regmatch.regprog = vim_regcomp(pat, RE_MAGIC); + if (flags & (EW_NOERROR | EW_NOTWILD)) + --emsg_silent; vim_free(pat); - if (regmatch.regprog == NULL) + if (regmatch.regprog == NULL && (flags & EW_NOTWILD) == 0) { vim_free(buf); return 0; @@ -9452,7 +9457,8 @@ unix_expandpath(gap, path, wildoff, flags, didstar) if (dp == NULL) break; if ((dp->d_name[0] != '.' || starts_with_dot) - && (vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0) + && ((regmatch.regprog != NULL && vim_regexec(®match, + (char_u *)dp->d_name, (colnr_T)0)) || ((flags & EW_NOTWILD) && fnamencmp(path + (s - buf), dp->d_name, e - s) == 0))) { diff --git a/src/version.c b/src/version.c index e3a79e294..f5e79e513 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 399, +/**/ 398, /**/ 397, |