diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-20 19:26:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-20 19:26:14 +0100 |
commit | 57e95179abdd851cb2d0c06d4f973575a768e3bb (patch) | |
tree | b46e223a591e688becbc9bc46c28194205c006ea /src/cmdexpand.c | |
parent | 2984ed31d92f7da19b3dc86b37764c55669dd7c2 (diff) |
patch 9.0.0231: expanding "**" may loop forever with directory linksv9.0.0231
Problem: Expanding "**" may loop forever with directory links.
Solution: Check for being interrupted. (closes #10946)
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r-- | src/cmdexpand.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c index ff6aa0d033..fb329a57d7 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -722,8 +722,9 @@ ExpandOne( findex = -1; // next p_wc gets first one } - // Concatenate all matching names - if (mode == WILD_ALL && xp->xp_numfiles > 0) + // Concatenate all matching names. Unless interrupted, this can be slow + // and the result probably won't be used. + if (mode == WILD_ALL && xp->xp_numfiles > 0 && !got_int) { len = 0; for (i = 0; i < xp->xp_numfiles; ++i) |