Bash-4.4 distribution sources and documentation
This commit is contained in:
parent
30a978b7d8
commit
a0c0a00fc4
588 changed files with 130746 additions and 80164 deletions
39
pcomplete.c
39
pcomplete.c
|
@ -117,7 +117,7 @@ static int it_init_setopts __P((ITEMLIST *));
|
|||
static int it_init_shopts __P((ITEMLIST *));
|
||||
|
||||
static int shouldexp_filterpat __P((char *));
|
||||
static char *preproc_filterpat __P((char *, char *));
|
||||
static char *preproc_filterpat __P((char *, const char *));
|
||||
|
||||
static void init_itemlist_from_varlist __P((ITEMLIST *, SVFUNC *));
|
||||
|
||||
|
@ -273,7 +273,7 @@ shouldexp_filterpat (s)
|
|||
static char *
|
||||
preproc_filterpat (pat, text)
|
||||
char *pat;
|
||||
char *text;
|
||||
const char *text;
|
||||
{
|
||||
char *ret;
|
||||
|
||||
|
@ -289,7 +289,8 @@ preproc_filterpat (pat, text)
|
|||
STRINGLIST *
|
||||
filter_stringlist (sl, filterpat, text)
|
||||
STRINGLIST *sl;
|
||||
char *filterpat, *text;
|
||||
char *filterpat;
|
||||
const char *text;
|
||||
{
|
||||
int i, m, not;
|
||||
STRINGLIST *ret;
|
||||
|
@ -300,13 +301,17 @@ filter_stringlist (sl, filterpat, text)
|
|||
|
||||
npat = shouldexp_filterpat (filterpat) ? preproc_filterpat (filterpat, text) : filterpat;
|
||||
|
||||
#if defined (EXTENDED_GLOB)
|
||||
not = (npat[0] == '!' && (extended_glob == 0 || npat[1] != '(')); /*)*/
|
||||
#else
|
||||
not = (npat[0] == '!');
|
||||
#endif
|
||||
t = not ? npat + 1 : npat;
|
||||
|
||||
ret = strlist_create (sl->list_size);
|
||||
for (i = 0; i < sl->list_len; i++)
|
||||
{
|
||||
m = strmatch (t, sl->list[i], FNMATCH_EXTFLAG);
|
||||
m = strmatch (t, sl->list[i], FNMATCH_EXTFLAG | FNMATCH_IGNCASE);
|
||||
if ((not && m == FNM_NOMATCH) || (not == 0 && m != FNM_NOMATCH))
|
||||
free (sl->list[i]);
|
||||
else
|
||||
|
@ -1020,13 +1025,13 @@ static void
|
|||
unbind_compfunc_variables (exported)
|
||||
int exported;
|
||||
{
|
||||
unbind_variable ("COMP_LINE");
|
||||
unbind_variable ("COMP_POINT");
|
||||
unbind_variable ("COMP_TYPE");
|
||||
unbind_variable ("COMP_KEY");
|
||||
unbind_variable_noref ("COMP_LINE");
|
||||
unbind_variable_noref ("COMP_POINT");
|
||||
unbind_variable_noref ("COMP_TYPE");
|
||||
unbind_variable_noref ("COMP_KEY");
|
||||
#ifdef ARRAY_VARS
|
||||
unbind_variable ("COMP_WORDS");
|
||||
unbind_variable ("COMP_CWORD");
|
||||
unbind_variable_noref ("COMP_WORDS");
|
||||
unbind_variable_noref ("COMP_CWORD");
|
||||
#endif
|
||||
if (exported)
|
||||
array_needs_making = 1;
|
||||
|
@ -1178,7 +1183,7 @@ gen_shell_function_matches (cs, cmd, text, line, ind, lwords, nw, cw, foundp)
|
|||
}
|
||||
|
||||
/* XXX - should we unbind COMPREPLY here? */
|
||||
unbind_variable ("COMPREPLY");
|
||||
unbind_variable_noref ("COMPREPLY");
|
||||
|
||||
return (sl);
|
||||
#endif
|
||||
|
@ -1187,9 +1192,9 @@ gen_shell_function_matches (cs, cmd, text, line, ind, lwords, nw, cw, foundp)
|
|||
/* Build a command string with
|
||||
$0 == cs->command (command to execute for completion list)
|
||||
$1 == command name (command being completed)
|
||||
$2 = word to be completed (possibly null)
|
||||
$3 = previous word
|
||||
and run in with command substitution. Parse the results, one word
|
||||
$2 == word to be completed (possibly null)
|
||||
$3 == previous word
|
||||
and run it with command substitution. Parse the results, one word
|
||||
per line, with backslashes allowed to escape newlines. Build a
|
||||
STRINGLIST from the results and return it. */
|
||||
|
||||
|
@ -1292,7 +1297,7 @@ command_line_to_word_list (line, llen, sentinel, nwp, cwp)
|
|||
#else
|
||||
delims = rl_completer_word_break_characters;
|
||||
#endif
|
||||
ret = split_at_delims (line, llen, delims, sentinel, SD_NOQUOTEDELIM, nwp, cwp);
|
||||
ret = split_at_delims (line, llen, delims, sentinel, SD_NOQUOTEDELIM|SD_COMPLETE, nwp, cwp);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
@ -1522,6 +1527,8 @@ pcomp_set_readline_variables (flags, nval)
|
|||
option is supposed to turn it off */
|
||||
if (flags & COPT_NOQUOTE)
|
||||
rl_filename_quoting_desired = 1 - nval;
|
||||
if (flags & COPT_NOSORT)
|
||||
rl_sort_completion_matches = 1 - nval;
|
||||
}
|
||||
|
||||
/* Set or unset FLAGS in the options word of the current compspec.
|
||||
|
@ -1636,7 +1643,7 @@ programmable_completions (cmd, word, start, end, foundp)
|
|||
|
||||
if (count > 32)
|
||||
{
|
||||
internal_warning ("programmable_completion: %s: possible retry loop", cmd);
|
||||
internal_warning (_("programmable_completion: %s: possible retry loop"), cmd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue