|
|
22c937 |
To: vim_dev@googlegroups.com
|
|
|
22c937 |
Subject: Patch 7.4.279
|
|
|
22c937 |
Fcc: outbox
|
|
|
22c937 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
|
22c937 |
Mime-Version: 1.0
|
|
|
22c937 |
Content-Type: text/plain; charset=UTF-8
|
|
|
22c937 |
Content-Transfer-Encoding: 8bit
|
|
|
22c937 |
------------
|
|
|
22c937 |
|
|
|
22c937 |
Patch 7.4.279
|
|
|
22c937 |
Problem: globpath() returns a string, making it difficult to get a list of
|
|
|
22c937 |
matches. (Greg Novack)
|
|
|
22c937 |
Solution: Add an optional argument like with glob(). (Adnan Zafar)
|
|
|
22c937 |
Files: runtime/doc/eval.txt, src/eval.c, src/ex_getln.c, src/misc1.c,
|
|
|
22c937 |
src/misc2.c, src/proto/ex_getln.pro, src/proto/misc2.pro,
|
|
|
22c937 |
src/testdir/test97.in, src/testdir/test97.ok
|
|
|
22c937 |
|
|
|
22c937 |
|
|
|
22c937 |
*** ../vim-7.4.278/runtime/doc/eval.txt 2014-04-23 17:43:37.350948683 +0200
|
|
|
22c937 |
--- runtime/doc/eval.txt 2014-05-07 17:38:03.045185916 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 1832,1838 ****
|
|
|
22c937 |
any variable {varname} in window {nr}
|
|
|
22c937 |
glob( {expr} [, {nosuf} [, {list}]])
|
|
|
22c937 |
any expand file wildcards in {expr}
|
|
|
22c937 |
! globpath( {path}, {expr} [, {flag}])
|
|
|
22c937 |
String do glob({expr}) for all dirs in {path}
|
|
|
22c937 |
has( {feature}) Number TRUE if feature {feature} supported
|
|
|
22c937 |
has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
|
|
|
22c937 |
--- 1832,1838 ----
|
|
|
22c937 |
any variable {varname} in window {nr}
|
|
|
22c937 |
glob( {expr} [, {nosuf} [, {list}]])
|
|
|
22c937 |
any expand file wildcards in {expr}
|
|
|
22c937 |
! globpath( {path}, {expr} [, {nosuf} [, {list}]])
|
|
|
22c937 |
String do glob({expr}) for all dirs in {path}
|
|
|
22c937 |
has( {feature}) Number TRUE if feature {feature} supported
|
|
|
22c937 |
has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 3570,3580 ****
|
|
|
22c937 |
See |expand()| for expanding special Vim variables. See
|
|
|
22c937 |
|system()| for getting the raw output of an external command.
|
|
|
22c937 |
|
|
|
22c937 |
! globpath({path}, {expr} [, {flag}]) *globpath()*
|
|
|
22c937 |
Perform glob() on all directories in {path} and concatenate
|
|
|
22c937 |
the results. Example: >
|
|
|
22c937 |
:echo globpath(&rtp, "syntax/c.vim")
|
|
|
22c937 |
! < {path} is a comma-separated list of directory names. Each
|
|
|
22c937 |
directory name is prepended to {expr} and expanded like with
|
|
|
22c937 |
|glob()|. A path separator is inserted when needed.
|
|
|
22c937 |
To add a comma inside a directory name escape it with a
|
|
|
22c937 |
--- 3571,3582 ----
|
|
|
22c937 |
See |expand()| for expanding special Vim variables. See
|
|
|
22c937 |
|system()| for getting the raw output of an external command.
|
|
|
22c937 |
|
|
|
22c937 |
! globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
|
|
|
22c937 |
Perform glob() on all directories in {path} and concatenate
|
|
|
22c937 |
the results. Example: >
|
|
|
22c937 |
:echo globpath(&rtp, "syntax/c.vim")
|
|
|
22c937 |
! <
|
|
|
22c937 |
! {path} is a comma-separated list of directory names. Each
|
|
|
22c937 |
directory name is prepended to {expr} and expanded like with
|
|
|
22c937 |
|glob()|. A path separator is inserted when needed.
|
|
|
22c937 |
To add a comma inside a directory name escape it with a
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 3582,3592 ****
|
|
|
22c937 |
trailing backslash, remove it if you put a comma after it.
|
|
|
22c937 |
If the expansion fails for one of the directories, there is no
|
|
|
22c937 |
error message.
|
|
|
22c937 |
! Unless the optional {flag} argument is given and is non-zero,
|
|
|
22c937 |
the 'suffixes' and 'wildignore' options apply: Names matching
|
|
|
22c937 |
one of the patterns in 'wildignore' will be skipped and
|
|
|
22c937 |
'suffixes' affect the ordering of matches.
|
|
|
22c937 |
|
|
|
22c937 |
The "**" item can be used to search in a directory tree.
|
|
|
22c937 |
For example, to find all "README.txt" files in the directories
|
|
|
22c937 |
in 'runtimepath' and below: >
|
|
|
22c937 |
--- 3584,3602 ----
|
|
|
22c937 |
trailing backslash, remove it if you put a comma after it.
|
|
|
22c937 |
If the expansion fails for one of the directories, there is no
|
|
|
22c937 |
error message.
|
|
|
22c937 |
!
|
|
|
22c937 |
! Unless the optional {nosuf} argument is given and is non-zero,
|
|
|
22c937 |
the 'suffixes' and 'wildignore' options apply: Names matching
|
|
|
22c937 |
one of the patterns in 'wildignore' will be skipped and
|
|
|
22c937 |
'suffixes' affect the ordering of matches.
|
|
|
22c937 |
|
|
|
22c937 |
+ When {list} is present and it is non-zero the result is a List
|
|
|
22c937 |
+ with all matching files. The advantage of using a List is, you
|
|
|
22c937 |
+ also get filenames containing newlines correctly. Otherwise
|
|
|
22c937 |
+ the result is a String and when there are several matches,
|
|
|
22c937 |
+ they are separated by <NL> characters. Example: >
|
|
|
22c937 |
+ :echo globpath(&rtp, "syntax/c.vim", 0, 1)
|
|
|
22c937 |
+ <
|
|
|
22c937 |
The "**" item can be used to search in a directory tree.
|
|
|
22c937 |
For example, to find all "README.txt" files in the directories
|
|
|
22c937 |
in 'runtimepath' and below: >
|
|
|
22c937 |
*** ../vim-7.4.278/src/eval.c 2014-05-07 17:31:32.473182497 +0200
|
|
|
22c937 |
--- src/eval.c 2014-05-07 18:06:29.541200854 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 7985,7991 ****
|
|
|
22c937 |
{"getwinposy", 0, 0, f_getwinposy},
|
|
|
22c937 |
{"getwinvar", 2, 3, f_getwinvar},
|
|
|
22c937 |
{"glob", 1, 3, f_glob},
|
|
|
22c937 |
! {"globpath", 2, 3, f_globpath},
|
|
|
22c937 |
{"has", 1, 1, f_has},
|
|
|
22c937 |
{"has_key", 2, 2, f_has_key},
|
|
|
22c937 |
{"haslocaldir", 0, 0, f_haslocaldir},
|
|
|
22c937 |
--- 7985,7991 ----
|
|
|
22c937 |
{"getwinposy", 0, 0, f_getwinposy},
|
|
|
22c937 |
{"getwinvar", 2, 3, f_getwinvar},
|
|
|
22c937 |
{"glob", 1, 3, f_glob},
|
|
|
22c937 |
! {"globpath", 2, 4, f_globpath},
|
|
|
22c937 |
{"has", 1, 1, f_has},
|
|
|
22c937 |
{"has_key", 2, 2, f_has_key},
|
|
|
22c937 |
{"haslocaldir", 0, 0, f_haslocaldir},
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 12151,12168 ****
|
|
|
22c937 |
char_u buf1[NUMBUFLEN];
|
|
|
22c937 |
char_u *file = get_tv_string_buf_chk(&argvars[1], buf1);
|
|
|
22c937 |
int error = FALSE;
|
|
|
22c937 |
|
|
|
22c937 |
/* When the optional second argument is non-zero, don't remove matches
|
|
|
22c937 |
* for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
|
|
22c937 |
- if (argvars[2].v_type != VAR_UNKNOWN
|
|
|
22c937 |
- && get_tv_number_chk(&argvars[2], &error))
|
|
|
22c937 |
- flags |= WILD_KEEP_ALL;
|
|
|
22c937 |
rettv->v_type = VAR_STRING;
|
|
|
22c937 |
! if (file == NULL || error)
|
|
|
22c937 |
! rettv->vval.v_string = NULL;
|
|
|
22c937 |
else
|
|
|
22c937 |
! rettv->vval.v_string = globpath(get_tv_string(&argvars[0]), file,
|
|
|
22c937 |
! flags);
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
/*
|
|
|
22c937 |
--- 12151,12187 ----
|
|
|
22c937 |
char_u buf1[NUMBUFLEN];
|
|
|
22c937 |
char_u *file = get_tv_string_buf_chk(&argvars[1], buf1);
|
|
|
22c937 |
int error = FALSE;
|
|
|
22c937 |
+ garray_T ga;
|
|
|
22c937 |
+ int i;
|
|
|
22c937 |
|
|
|
22c937 |
/* When the optional second argument is non-zero, don't remove matches
|
|
|
22c937 |
* for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
|
|
22c937 |
rettv->v_type = VAR_STRING;
|
|
|
22c937 |
! if (argvars[2].v_type != VAR_UNKNOWN)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! if (get_tv_number_chk(&argvars[2], &error))
|
|
|
22c937 |
! flags |= WILD_KEEP_ALL;
|
|
|
22c937 |
! if (argvars[3].v_type != VAR_UNKNOWN
|
|
|
22c937 |
! && get_tv_number_chk(&argvars[3], &error))
|
|
|
22c937 |
! {
|
|
|
22c937 |
! rettv->v_type = VAR_LIST;
|
|
|
22c937 |
! rettv->vval.v_list = NULL;
|
|
|
22c937 |
! }
|
|
|
22c937 |
! }
|
|
|
22c937 |
! if (file != NULL && !error)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! ga_init2(&ga, (int)sizeof(char_u *), 10);
|
|
|
22c937 |
! globpath(get_tv_string(&argvars[0]), file, &ga, flags);
|
|
|
22c937 |
! if (rettv->v_type == VAR_STRING)
|
|
|
22c937 |
! rettv->vval.v_string = ga_concat_strings(&ga, "\n");
|
|
|
22c937 |
! else if (rettv_list_alloc(rettv) != FAIL)
|
|
|
22c937 |
! for (i = 0; i < ga.ga_len; ++i)
|
|
|
22c937 |
! list_append_string(rettv->vval.v_list,
|
|
|
22c937 |
! ((char_u **)(ga.ga_data))[i], -1);
|
|
|
22c937 |
! ga_clear_strings(&ga);
|
|
|
22c937 |
! }
|
|
|
22c937 |
else
|
|
|
22c937 |
! rettv->vval.v_string = NULL;
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
/*
|
|
|
22c937 |
*** ../vim-7.4.278/src/ex_getln.c 2013-11-12 05:28:08.000000000 +0100
|
|
|
22c937 |
--- src/ex_getln.c 2014-05-07 18:11:49.281203653 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 5095,5103 ****
|
|
|
22c937 |
char_u ***file;
|
|
|
22c937 |
char *dirnames[];
|
|
|
22c937 |
{
|
|
|
22c937 |
- char_u *matches;
|
|
|
22c937 |
char_u *s;
|
|
|
22c937 |
char_u *e;
|
|
|
22c937 |
garray_T ga;
|
|
|
22c937 |
int i;
|
|
|
22c937 |
int pat_len;
|
|
|
22c937 |
--- 5095,5103 ----
|
|
|
22c937 |
char_u ***file;
|
|
|
22c937 |
char *dirnames[];
|
|
|
22c937 |
{
|
|
|
22c937 |
char_u *s;
|
|
|
22c937 |
char_u *e;
|
|
|
22c937 |
+ char_u *match;
|
|
|
22c937 |
garray_T ga;
|
|
|
22c937 |
int i;
|
|
|
22c937 |
int pat_len;
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 5116,5148 ****
|
|
|
22c937 |
return FAIL;
|
|
|
22c937 |
}
|
|
|
22c937 |
sprintf((char *)s, "%s/%s*.vim", dirnames[i], pat);
|
|
|
22c937 |
! matches = globpath(p_rtp, s, 0);
|
|
|
22c937 |
vim_free(s);
|
|
|
22c937 |
! if (matches == NULL)
|
|
|
22c937 |
! continue;
|
|
|
22c937 |
|
|
|
22c937 |
! for (s = matches; *s != NUL; s = e)
|
|
|
22c937 |
{
|
|
|
22c937 |
! e = vim_strchr(s, '\n');
|
|
|
22c937 |
! if (e == NULL)
|
|
|
22c937 |
! e = s + STRLEN(s);
|
|
|
22c937 |
! if (ga_grow(&ga, 1) == FAIL)
|
|
|
22c937 |
! break;
|
|
|
22c937 |
! if (e - 4 > s && STRNICMP(e - 4, ".vim", 4) == 0)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! for (s = e - 4; s > matches; mb_ptr_back(matches, s))
|
|
|
22c937 |
! if (*s == '\n' || vim_ispathsep(*s))
|
|
|
22c937 |
! break;
|
|
|
22c937 |
! ++s;
|
|
|
22c937 |
! ((char_u **)ga.ga_data)[ga.ga_len] =
|
|
|
22c937 |
! vim_strnsave(s, (int)(e - s - 4));
|
|
|
22c937 |
! ++ga.ga_len;
|
|
|
22c937 |
! }
|
|
|
22c937 |
! if (*e != NUL)
|
|
|
22c937 |
! ++e;
|
|
|
22c937 |
}
|
|
|
22c937 |
- vim_free(matches);
|
|
|
22c937 |
}
|
|
|
22c937 |
if (ga.ga_len == 0)
|
|
|
22c937 |
return FAIL;
|
|
|
22c937 |
|
|
|
22c937 |
--- 5116,5142 ----
|
|
|
22c937 |
return FAIL;
|
|
|
22c937 |
}
|
|
|
22c937 |
sprintf((char *)s, "%s/%s*.vim", dirnames[i], pat);
|
|
|
22c937 |
! globpath(p_rtp, s, &ga, 0);
|
|
|
22c937 |
vim_free(s);
|
|
|
22c937 |
! }
|
|
|
22c937 |
|
|
|
22c937 |
! for (i = 0; i < ga.ga_len; ++i)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! match = ((char_u **)ga.ga_data)[i];
|
|
|
22c937 |
! s = match;
|
|
|
22c937 |
! e = s + STRLEN(s);
|
|
|
22c937 |
! if (e - 4 > s && STRNICMP(e - 4, ".vim", 4) == 0)
|
|
|
22c937 |
{
|
|
|
22c937 |
! e -= 4;
|
|
|
22c937 |
! for (s = e; s > match; mb_ptr_back(match, s))
|
|
|
22c937 |
! if (s < match || vim_ispathsep(*s))
|
|
|
22c937 |
! break;
|
|
|
22c937 |
! ++s;
|
|
|
22c937 |
! *e = NUL;
|
|
|
22c937 |
! mch_memmove(match, s, e - s + 1);
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
+
|
|
|
22c937 |
if (ga.ga_len == 0)
|
|
|
22c937 |
return FAIL;
|
|
|
22c937 |
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 5160,5192 ****
|
|
|
22c937 |
#if defined(FEAT_CMDL_COMPL) || defined(FEAT_EVAL) || defined(PROTO)
|
|
|
22c937 |
/*
|
|
|
22c937 |
* Expand "file" for all comma-separated directories in "path".
|
|
|
22c937 |
! * Returns an allocated string with all matches concatenated, separated by
|
|
|
22c937 |
! * newlines. Returns NULL for an error or no matches.
|
|
|
22c937 |
*/
|
|
|
22c937 |
! char_u *
|
|
|
22c937 |
! globpath(path, file, expand_options)
|
|
|
22c937 |
char_u *path;
|
|
|
22c937 |
char_u *file;
|
|
|
22c937 |
int expand_options;
|
|
|
22c937 |
{
|
|
|
22c937 |
expand_T xpc;
|
|
|
22c937 |
char_u *buf;
|
|
|
22c937 |
- garray_T ga;
|
|
|
22c937 |
int i;
|
|
|
22c937 |
- int len;
|
|
|
22c937 |
int num_p;
|
|
|
22c937 |
char_u **p;
|
|
|
22c937 |
- char_u *cur = NULL;
|
|
|
22c937 |
|
|
|
22c937 |
buf = alloc(MAXPATHL);
|
|
|
22c937 |
if (buf == NULL)
|
|
|
22c937 |
! return NULL;
|
|
|
22c937 |
|
|
|
22c937 |
ExpandInit(&xpc);
|
|
|
22c937 |
xpc.xp_context = EXPAND_FILES;
|
|
|
22c937 |
|
|
|
22c937 |
- ga_init2(&ga, 1, 100);
|
|
|
22c937 |
-
|
|
|
22c937 |
/* Loop over all entries in {path}. */
|
|
|
22c937 |
while (*path != NUL)
|
|
|
22c937 |
{
|
|
|
22c937 |
--- 5154,5181 ----
|
|
|
22c937 |
#if defined(FEAT_CMDL_COMPL) || defined(FEAT_EVAL) || defined(PROTO)
|
|
|
22c937 |
/*
|
|
|
22c937 |
* Expand "file" for all comma-separated directories in "path".
|
|
|
22c937 |
! * Adds the matches to "ga". Caller must init "ga".
|
|
|
22c937 |
*/
|
|
|
22c937 |
! void
|
|
|
22c937 |
! globpath(path, file, ga, expand_options)
|
|
|
22c937 |
char_u *path;
|
|
|
22c937 |
char_u *file;
|
|
|
22c937 |
+ garray_T *ga;
|
|
|
22c937 |
int expand_options;
|
|
|
22c937 |
{
|
|
|
22c937 |
expand_T xpc;
|
|
|
22c937 |
char_u *buf;
|
|
|
22c937 |
int i;
|
|
|
22c937 |
int num_p;
|
|
|
22c937 |
char_u **p;
|
|
|
22c937 |
|
|
|
22c937 |
buf = alloc(MAXPATHL);
|
|
|
22c937 |
if (buf == NULL)
|
|
|
22c937 |
! return;
|
|
|
22c937 |
|
|
|
22c937 |
ExpandInit(&xpc);
|
|
|
22c937 |
xpc.xp_context = EXPAND_FILES;
|
|
|
22c937 |
|
|
|
22c937 |
/* Loop over all entries in {path}. */
|
|
|
22c937 |
while (*path != NUL)
|
|
|
22c937 |
{
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 5207,5236 ****
|
|
|
22c937 |
WILD_SILENT|expand_options) != FAIL && num_p > 0)
|
|
|
22c937 |
{
|
|
|
22c937 |
ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options);
|
|
|
22c937 |
- for (len = 0, i = 0; i < num_p; ++i)
|
|
|
22c937 |
- len += (int)STRLEN(p[i]) + 1;
|
|
|
22c937 |
|
|
|
22c937 |
! /* Concatenate new results to previous ones. */
|
|
|
22c937 |
! if (ga_grow(&ga, len) == OK)
|
|
|
22c937 |
{
|
|
|
22c937 |
- cur = (char_u *)ga.ga_data + ga.ga_len;
|
|
|
22c937 |
for (i = 0; i < num_p; ++i)
|
|
|
22c937 |
{
|
|
|
22c937 |
! STRCPY(cur, p[i]);
|
|
|
22c937 |
! cur += STRLEN(p[i]);
|
|
|
22c937 |
! *cur++ = '\n';
|
|
|
22c937 |
}
|
|
|
22c937 |
- ga.ga_len += len;
|
|
|
22c937 |
}
|
|
|
22c937 |
FreeWild(num_p, p);
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
- if (cur != NULL)
|
|
|
22c937 |
- *--cur = 0; /* Replace trailing newline with NUL */
|
|
|
22c937 |
|
|
|
22c937 |
vim_free(buf);
|
|
|
22c937 |
- return (char_u *)ga.ga_data;
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
#endif
|
|
|
22c937 |
--- 5196,5218 ----
|
|
|
22c937 |
WILD_SILENT|expand_options) != FAIL && num_p > 0)
|
|
|
22c937 |
{
|
|
|
22c937 |
ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options);
|
|
|
22c937 |
|
|
|
22c937 |
! if (ga_grow(ga, num_p) == OK)
|
|
|
22c937 |
{
|
|
|
22c937 |
for (i = 0; i < num_p; ++i)
|
|
|
22c937 |
{
|
|
|
22c937 |
! ((char_u **)ga->ga_data)[ga->ga_len] =
|
|
|
22c937 |
! vim_strnsave(p[i], STRLEN(p[i]));
|
|
|
22c937 |
! ++ga->ga_len;
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
+
|
|
|
22c937 |
FreeWild(num_p, p);
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
vim_free(buf);
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
#endif
|
|
|
22c937 |
*** ../vim-7.4.278/src/misc1.c 2014-05-07 15:10:17.657108310 +0200
|
|
|
22c937 |
--- src/misc1.c 2014-05-07 17:46:30.269190356 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 10336,10344 ****
|
|
|
22c937 |
{
|
|
|
22c937 |
char_u *curdir;
|
|
|
22c937 |
garray_T path_ga;
|
|
|
22c937 |
- char_u *files = NULL;
|
|
|
22c937 |
- char_u *s; /* start */
|
|
|
22c937 |
- char_u *e; /* end */
|
|
|
22c937 |
char_u *paths = NULL;
|
|
|
22c937 |
|
|
|
22c937 |
if ((curdir = alloc((unsigned)MAXPATHL)) == NULL)
|
|
|
22c937 |
--- 10336,10341 ----
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 10351,10387 ****
|
|
|
22c937 |
if (path_ga.ga_len == 0)
|
|
|
22c937 |
return 0;
|
|
|
22c937 |
|
|
|
22c937 |
! paths = ga_concat_strings(&path_ga);
|
|
|
22c937 |
ga_clear_strings(&path_ga);
|
|
|
22c937 |
if (paths == NULL)
|
|
|
22c937 |
return 0;
|
|
|
22c937 |
|
|
|
22c937 |
! files = globpath(paths, pattern, (flags & EW_ICASE) ? WILD_ICASE : 0);
|
|
|
22c937 |
vim_free(paths);
|
|
|
22c937 |
- if (files == NULL)
|
|
|
22c937 |
- return 0;
|
|
|
22c937 |
-
|
|
|
22c937 |
- /* Copy each path in files into gap */
|
|
|
22c937 |
- s = e = files;
|
|
|
22c937 |
- while (*s != NUL)
|
|
|
22c937 |
- {
|
|
|
22c937 |
- while (*e != '\n' && *e != NUL)
|
|
|
22c937 |
- e++;
|
|
|
22c937 |
- if (*e == NUL)
|
|
|
22c937 |
- {
|
|
|
22c937 |
- addfile(gap, s, flags);
|
|
|
22c937 |
- break;
|
|
|
22c937 |
- }
|
|
|
22c937 |
- else
|
|
|
22c937 |
- {
|
|
|
22c937 |
- /* *e is '\n' */
|
|
|
22c937 |
- *e = NUL;
|
|
|
22c937 |
- addfile(gap, s, flags);
|
|
|
22c937 |
- e++;
|
|
|
22c937 |
- s = e;
|
|
|
22c937 |
- }
|
|
|
22c937 |
- }
|
|
|
22c937 |
- vim_free(files);
|
|
|
22c937 |
|
|
|
22c937 |
return gap->ga_len;
|
|
|
22c937 |
}
|
|
|
22c937 |
--- 10348,10360 ----
|
|
|
22c937 |
if (path_ga.ga_len == 0)
|
|
|
22c937 |
return 0;
|
|
|
22c937 |
|
|
|
22c937 |
! paths = ga_concat_strings(&path_ga, ",");
|
|
|
22c937 |
ga_clear_strings(&path_ga);
|
|
|
22c937 |
if (paths == NULL)
|
|
|
22c937 |
return 0;
|
|
|
22c937 |
|
|
|
22c937 |
! globpath(paths, pattern, gap, (flags & EW_ICASE) ? WILD_ICASE : 0);
|
|
|
22c937 |
vim_free(paths);
|
|
|
22c937 |
|
|
|
22c937 |
return gap->ga_len;
|
|
|
22c937 |
}
|
|
|
22c937 |
*** ../vim-7.4.278/src/misc2.c 2014-03-23 15:12:29.927264336 +0100
|
|
|
22c937 |
--- src/misc2.c 2014-05-07 18:34:37.689215632 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 2087,2115 ****
|
|
|
22c937 |
|
|
|
22c937 |
/*
|
|
|
22c937 |
* For a growing array that contains a list of strings: concatenate all the
|
|
|
22c937 |
! * strings with a separating comma.
|
|
|
22c937 |
* Returns NULL when out of memory.
|
|
|
22c937 |
*/
|
|
|
22c937 |
char_u *
|
|
|
22c937 |
! ga_concat_strings(gap)
|
|
|
22c937 |
garray_T *gap;
|
|
|
22c937 |
{
|
|
|
22c937 |
int i;
|
|
|
22c937 |
int len = 0;
|
|
|
22c937 |
char_u *s;
|
|
|
22c937 |
|
|
|
22c937 |
for (i = 0; i < gap->ga_len; ++i)
|
|
|
22c937 |
! len += (int)STRLEN(((char_u **)(gap->ga_data))[i]) + 1;
|
|
|
22c937 |
|
|
|
22c937 |
s = alloc(len + 1);
|
|
|
22c937 |
if (s != NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
*s = NUL;
|
|
|
22c937 |
for (i = 0; i < gap->ga_len; ++i)
|
|
|
22c937 |
{
|
|
|
22c937 |
! if (*s != NUL)
|
|
|
22c937 |
! STRCAT(s, ",");
|
|
|
22c937 |
! STRCAT(s, ((char_u **)(gap->ga_data))[i]);
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
return s;
|
|
|
22c937 |
--- 2087,2123 ----
|
|
|
22c937 |
|
|
|
22c937 |
/*
|
|
|
22c937 |
* For a growing array that contains a list of strings: concatenate all the
|
|
|
22c937 |
! * strings with a separating "sep".
|
|
|
22c937 |
* Returns NULL when out of memory.
|
|
|
22c937 |
*/
|
|
|
22c937 |
char_u *
|
|
|
22c937 |
! ga_concat_strings(gap, sep)
|
|
|
22c937 |
garray_T *gap;
|
|
|
22c937 |
+ char *sep;
|
|
|
22c937 |
{
|
|
|
22c937 |
int i;
|
|
|
22c937 |
int len = 0;
|
|
|
22c937 |
+ int sep_len = (int)STRLEN(sep);
|
|
|
22c937 |
char_u *s;
|
|
|
22c937 |
+ char_u *p;
|
|
|
22c937 |
|
|
|
22c937 |
for (i = 0; i < gap->ga_len; ++i)
|
|
|
22c937 |
! len += (int)STRLEN(((char_u **)(gap->ga_data))[i]) + sep_len;
|
|
|
22c937 |
|
|
|
22c937 |
s = alloc(len + 1);
|
|
|
22c937 |
if (s != NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
*s = NUL;
|
|
|
22c937 |
+ p = s;
|
|
|
22c937 |
for (i = 0; i < gap->ga_len; ++i)
|
|
|
22c937 |
{
|
|
|
22c937 |
! if (p != s)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! STRCPY(p, sep);
|
|
|
22c937 |
! p += sep_len;
|
|
|
22c937 |
! }
|
|
|
22c937 |
! STRCPY(p, ((char_u **)(gap->ga_data))[i]);
|
|
|
22c937 |
! p += STRLEN(p);
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
return s;
|
|
|
22c937 |
*** ../vim-7.4.278/src/proto/ex_getln.pro 2013-08-10 13:37:11.000000000 +0200
|
|
|
22c937 |
--- src/proto/ex_getln.pro 2014-05-07 17:52:42.457193614 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 32,38 ****
|
|
|
22c937 |
void set_cmd_context __ARGS((expand_T *xp, char_u *str, int len, int col));
|
|
|
22c937 |
int expand_cmdline __ARGS((expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches));
|
|
|
22c937 |
int ExpandGeneric __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file, char_u *((*func)(expand_T *, int)), int escaped));
|
|
|
22c937 |
! char_u *globpath __ARGS((char_u *path, char_u *file, int expand_options));
|
|
|
22c937 |
void init_history __ARGS((void));
|
|
|
22c937 |
int get_histtype __ARGS((char_u *name));
|
|
|
22c937 |
void add_to_history __ARGS((int histype, char_u *new_entry, int in_map, int sep));
|
|
|
22c937 |
--- 32,38 ----
|
|
|
22c937 |
void set_cmd_context __ARGS((expand_T *xp, char_u *str, int len, int col));
|
|
|
22c937 |
int expand_cmdline __ARGS((expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches));
|
|
|
22c937 |
int ExpandGeneric __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file, char_u *((*func)(expand_T *, int)), int escaped));
|
|
|
22c937 |
! void globpath __ARGS((char_u *path, char_u *file, garray_T *ga, int expand_options));
|
|
|
22c937 |
void init_history __ARGS((void));
|
|
|
22c937 |
int get_histtype __ARGS((char_u *name));
|
|
|
22c937 |
void add_to_history __ARGS((int histype, char_u *new_entry, int in_map, int sep));
|
|
|
22c937 |
*** ../vim-7.4.278/src/proto/misc2.pro 2014-02-23 23:38:58.828760280 +0100
|
|
|
22c937 |
--- src/proto/misc2.pro 2014-05-07 17:52:36.189193559 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 55,61 ****
|
|
|
22c937 |
void ga_init __ARGS((garray_T *gap));
|
|
|
22c937 |
void ga_init2 __ARGS((garray_T *gap, int itemsize, int growsize));
|
|
|
22c937 |
int ga_grow __ARGS((garray_T *gap, int n));
|
|
|
22c937 |
! char_u *ga_concat_strings __ARGS((garray_T *gap));
|
|
|
22c937 |
void ga_concat __ARGS((garray_T *gap, char_u *s));
|
|
|
22c937 |
void ga_append __ARGS((garray_T *gap, int c));
|
|
|
22c937 |
void append_ga_line __ARGS((garray_T *gap));
|
|
|
22c937 |
--- 55,61 ----
|
|
|
22c937 |
void ga_init __ARGS((garray_T *gap));
|
|
|
22c937 |
void ga_init2 __ARGS((garray_T *gap, int itemsize, int growsize));
|
|
|
22c937 |
int ga_grow __ARGS((garray_T *gap, int n));
|
|
|
22c937 |
! char_u *ga_concat_strings __ARGS((garray_T *gap, char *sep));
|
|
|
22c937 |
void ga_concat __ARGS((garray_T *gap, char_u *s));
|
|
|
22c937 |
void ga_append __ARGS((garray_T *gap, int c));
|
|
|
22c937 |
void append_ga_line __ARGS((garray_T *gap));
|
|
|
22c937 |
*** ../vim-7.4.278/src/testdir/test97.in 2013-08-02 14:55:50.000000000 +0200
|
|
|
22c937 |
--- src/testdir/test97.in 2014-05-07 18:27:59.213212144 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 5,16 ****
|
|
|
22c937 |
:so small.vim
|
|
|
22c937 |
:set shell=doesnotexist
|
|
|
22c937 |
:e test.out
|
|
|
22c937 |
! :put =glob('Xxx\{')
|
|
|
22c937 |
! :put =glob('Xxx\$')
|
|
|
22c937 |
:w! Xxx{
|
|
|
22c937 |
:w! Xxx\$
|
|
|
22c937 |
! :put =glob('Xxx\{')
|
|
|
22c937 |
! :put =glob('Xxx\$')
|
|
|
22c937 |
:w
|
|
|
22c937 |
:qa!
|
|
|
22c937 |
ENDTEST
|
|
|
22c937 |
--- 5,19 ----
|
|
|
22c937 |
:so small.vim
|
|
|
22c937 |
:set shell=doesnotexist
|
|
|
22c937 |
:e test.out
|
|
|
22c937 |
! :$put =glob('Xxx\{')
|
|
|
22c937 |
! :$put =glob('Xxx\$')
|
|
|
22c937 |
:w! Xxx{
|
|
|
22c937 |
:w! Xxx\$
|
|
|
22c937 |
! :$put =glob('Xxx\{')
|
|
|
22c937 |
! :$put =glob('Xxx\$')
|
|
|
22c937 |
! :"
|
|
|
22c937 |
! :$put =string(globpath('sautest/autoload', '*.vim'))
|
|
|
22c937 |
! :$put =string(globpath('sautest/autoload', '*.vim', 0, 1))
|
|
|
22c937 |
:w
|
|
|
22c937 |
:qa!
|
|
|
22c937 |
ENDTEST
|
|
|
22c937 |
*** ../vim-7.4.278/src/testdir/test97.ok 2013-07-03 16:14:50.000000000 +0200
|
|
|
22c937 |
--- src/testdir/test97.ok 2014-05-07 18:28:01.985212168 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 3,5 ****
|
|
|
22c937 |
--- 3,8 ----
|
|
|
22c937 |
|
|
|
22c937 |
Xxx{
|
|
|
22c937 |
Xxx$
|
|
|
22c937 |
+ 'sautest/autoload/Test104.vim
|
|
|
22c937 |
+ sautest/autoload/footest.vim'
|
|
|
22c937 |
+ ['sautest/autoload/Test104.vim', 'sautest/autoload/footest.vim']
|
|
|
22c937 |
*** ../vim-7.4.278/src/version.c 2014-05-07 17:31:32.473182497 +0200
|
|
|
22c937 |
--- src/version.c 2014-05-07 17:35:06.253184368 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 736,737 ****
|
|
|
22c937 |
--- 736,739 ----
|
|
|
22c937 |
{ /* Add new patch number below this line */
|
|
|
22c937 |
+ /**/
|
|
|
22c937 |
+ 279,
|
|
|
22c937 |
/**/
|
|
|
22c937 |
|
|
|
22c937 |
--
|
|
|
22c937 |
hundred-and-one symptoms of being an internet addict:
|
|
|
22c937 |
121. You ask for e-mail adresses instead of telephone numbers.
|
|
|
22c937 |
|
|
|
22c937 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
|
22c937 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
|
22c937 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
|
22c937 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|