patch 9.0.0231: expanding "**" may loop forever with directory links
Problem: Expanding "**" may loop forever with directory links.
Solution: Check for being interrupted. (closes #10946)
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index ff6aa0d..fb329a5 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -722,8 +722,9 @@
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)