file_pat_to_reg_pat, buflist_findpat: const params

file_pat_to_reg_pat() and buflist_findpat() do not modify the data of
these parameters.
This commit is contained in:
Justin M. Keyes
2015-12-26 20:12:24 -05:00
parent 76bf21de26
commit 3fd62f9612
3 changed files with 41 additions and 46 deletions

View File

@@ -7096,26 +7096,23 @@ int match_file_list(char_u *list, char_u *sfname, char_u *ffname)
return FALSE;
}
/*
* Convert the given pattern "pat" which has shell style wildcards in it, into
* a regular expression, and return the result in allocated memory. If there
* is a directory path separator to be matched, then TRUE is put in
* allow_dirs, otherwise FALSE is put there -- webb.
* Handle backslashes before special characters, like "\*" and "\ ".
*
* Returns NULL on failure.
*/
char_u *
file_pat_to_reg_pat (
char_u *pat,
char_u *pat_end, /* first char after pattern or NULL */
char *allow_dirs, /* Result passed back out in here */
int no_bslash /* Don't use a backward slash as pathsep */
/// Convert the given pattern "pat" which has shell style wildcards in it, into
/// a regular expression, and return the result in allocated memory. If there
/// is a directory path separator to be matched, then TRUE is put in
/// allow_dirs, otherwise FALSE is put there -- webb.
/// Handle backslashes before special characters, like "\*" and "\ ".
///
/// Returns NULL on failure.
char_u * file_pat_to_reg_pat(
const char_u *pat,
const char_u *pat_end, // first char after pattern or NULL
char *allow_dirs, // Result passed back out in here
int no_bslash // Don't use a backward slash as pathsep
)
{
char_u *endp;
const char_u *endp;
char_u *reg_pat;
char_u *p;
const char_u *p;
int nested = 0;
int add_dollar = TRUE;