commit bash-20040108 snapshot

This commit is contained in:
Chet Ramey
2011-12-03 12:53:09 -05:00
parent 5e13499c55
commit 545f34cfd4
34 changed files with 75981 additions and 5820 deletions
+23
View File
@@ -1010,6 +1010,7 @@ compute_lcd_of_matches (match_list, matches, text)
{
register int i, c1, c2, si;
int low; /* Count of max-matched characters. */
char *dtext; /* dequoted TEXT, if needed */
#if defined (HANDLE_MULTIBYTE)
int v;
mbstate_t ps1, ps2;
@@ -1101,6 +1102,26 @@ compute_lcd_of_matches (match_list, matches, text)
the user typed in the face of multiple matches differing in case. */
if (_rl_completion_case_fold)
{
/* We're making an assumption here:
IF we're completing filenames AND
the application has defined a filename dequoting function AND
we found a quote character AND
the application has requested filename quoting
THEN
we assume that TEXT was dequoted before checking against
the file system and needs to be dequoted here before we
check against the list of matches
FI */
dtext = (char *)NULL;
if (rl_filename_completion_desired &&
rl_filename_dequoting_function &&
rl_completion_found_quote &&
rl_filename_quoting_desired)
{
dtext = (*rl_filename_dequoting_function) (text, rl_completion_quote_character);
text = dtext;
}
/* sort the list to get consistent answers. */
qsort (match_list+1, matches, sizeof(char *), (QSFUNC *)_rl_qsort_string_compare);
@@ -1120,6 +1141,8 @@ compute_lcd_of_matches (match_list, matches, text)
else
/* otherwise, just use the text the user typed. */
strncpy (match_list[0], text, low);
FREE (dtext);
}
else
strncpy (match_list[0], match_list[1], low);
+7 -9
View File
@@ -316,7 +316,7 @@ rl_expand_prompt (prompt)
t = ++p;
local_prompt = expand_prompt (p, &prompt_visible_length,
&prompt_last_invisible,
&prompt_invis_chars_first_line);
(int *)NULL);
c = *t; *t = '\0';
/* The portion of the prompt string up to and including the
final newline is now null-terminated. */
@@ -546,15 +546,13 @@ rl_redisplay ()
prompt_invis_chars_first_line variable could be made into an array
saying how many invisible characters there are per line, but that's
probably too much work for the benefit gained. How many people have
prompts that exceed two physical lines? */
prompts that exceed two physical lines?
Additional logic fix from Edward Catmur <ed@catmur.co.uk> */
temp = ((newlines + 1) * _rl_screenwidth) +
#if 0
((newlines == 0) ? prompt_invis_chars_first_line : 0) +
#else
((newlines == 0 && local_prompt_prefix == 0) ? prompt_invis_chars_first_line : 0) +
#endif
((newlines == 1) ? wrap_offset : 0);
((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line
: ((newlines == 1) ? wrap_offset : 0))
: ((newlines == 0) ? wrap_offset :0));
inv_lbreaks[++newlines] = temp;
lpos -= _rl_screenwidth;
}
+7
View File
@@ -1728,6 +1728,13 @@ It is set to 0 before any application-specific completion function
is called, and may only be changed within such a function.
@end deftypevar
@deftypevar int rl_completion_found_quote
When Readline is completing quoted text, it sets this variable
to a non-zero value if the word being completed contains or is delimited
by any quoting characters, including backslashes.
This is set before any application-specific completion function is called.
@end deftypevar
@deftypevar int rl_completion_mark_symlink_dirs
If non-zero, a slash will be appended to completed filenames that are
symbolic links to directory names, subject to the value of the
+4 -4
View File
@@ -1,10 +1,10 @@
@ignore
Copyright (C) 1988-2003 Free Software Foundation, Inc.
Copyright (C) 1988-2004 Free Software Foundation, Inc.
@end ignore
@set EDITION 5.0
@set VERSION 5.0
@set UPDATED 11 October 2003
@set UPDATED-MONTH October 2003
@set UPDATED 8 January 2004
@set UPDATED-MONTH January 2003
@set LASTCHANGE Sat Oct 11 23:48:11 EDT 2003
@set LASTCHANGE Thu Jan 8 10:34:23 EST 2004