0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.0046

This commit is contained in:
Bram Moolenaar
2005-01-31 19:09:12 +00:00
parent 65c1b01669
commit b23c33872a
11 changed files with 1841 additions and 1473 deletions

View File

@@ -4873,8 +4873,32 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
/* "unset nonomatch; print -N >" plus two is 29 */
len = STRLEN(tempname) + 29;
for (i = 0; i < num_pat; ++i) /* count the length of the patterns */
for (i = 0; i < num_pat; ++i)
{
/* Count the length of the patterns in the same way as they are put in
* "command" below. */
#ifdef USE_SYSTEM
len += STRLEN(pat[i]) + 3; /* add space and two quotes */
#else
++len; /* add space */
for (j = 0; pat[i][j] != NUL; )
if (vim_strchr((char_u *)" '", pat[i][j]) != NULL)
{
len += 2; /* add two quotes */
while (pat[i][j] != NUL
&& vim_strchr((char_u *)" '", pat[i][j]) != NULL)
{
++len;
++j;
}
}
else
{
++len;
++j;
}
#endif
}
command = alloc(len);
if (command == NULL)
{