vim_snprintf((char *)buf + len, buflen - len, "%s", path_end);
if (mch_has_exp_wildcard(path_end))
{
- // need to expand another component of the path
- // remove backslashes for the remaining components only
- (void)dos_expandpath(gap, buf, len + 1, flags, FALSE);
+ if (stardepth < 100)
+ {
+ // need to expand another component of the path
+ // remove backslashes for the remaining components only
+ ++stardepth;
+ (void)dos_expandpath(gap, buf, len + 1, flags, FALSE);
+ --stardepth;
+ }
}
else
{
vim_snprintf((char *)buf + len, buflen - len, "%s", path_end);
if (mch_has_exp_wildcard(path_end)) // handle more wildcards
{
- // need to expand another component of the path
- // remove backslashes for the remaining components only
- (void)unix_expandpath(gap, buf, len + 1, flags, FALSE);
+ if (stardepth < 100)
+ {
+ // need to expand another component of the path
+ // remove backslashes for the remaining components only
+ ++stardepth;
+ (void)unix_expandpath(gap, buf, len + 1, flags, FALSE);
+ --stardepth;
+ }
}
else
{