aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-04-19 17:07:33 +0200
committerGitHub <noreply@github.com>2023-04-19 17:07:33 +0200
commit3940c435e4058f75b8ecbfc9f9c3b2a2c4b64f37 (patch)
tree3c23ed475376a20f2334f5131ebc5b39f6afe343 /src/nvim/path.c
parentea52961c54797fc27e305eb4bb11a5d2c4cdda58 (diff)
parentaee6f08ce12a62e9104892702a658a8d3daee4df (diff)
downloadrneovim-3940c435e4058f75b8ecbfc9f9c3b2a2c4b64f37.tar.gz
rneovim-3940c435e4058f75b8ecbfc9f9c3b2a2c4b64f37.tar.bz2
rneovim-3940c435e4058f75b8ecbfc9f9c3b2a2c4b64f37.zip
Merge pull request #23155 from bfredl/nobreak
fix(runtime): do not allow breakcheck inside runtime path calculation
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index cf7cd98829..21a3a67e24 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -620,7 +620,7 @@ static size_t do_path_expand(garray_T *gap, const char *path, size_t wildoff, in
static int stardepth = 0; // depth for "**" expansion
// Expanding "**" may take a long time, check for CTRL-C.
- if (stardepth > 0) {
+ if (stardepth > 0 && !(flags & EW_NOBREAK)) {
os_breakcheck();
if (got_int) {
return 0;
@@ -701,7 +701,8 @@ static size_t do_path_expand(garray_T *gap, const char *path, size_t wildoff, in
if (flags & (EW_NOERROR | EW_NOTWILD)) {
emsg_silent++;
}
- regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
+ bool nobreak = (flags & EW_NOBREAK);
+ regmatch.regprog = vim_regcomp(pat, RE_MAGIC | (nobreak ? RE_NOBREAK : 0));
if (flags & (EW_NOERROR | EW_NOTWILD)) {
emsg_silent--;
}