mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Add fixes from bash beta
Back out trailing spaces changes
This commit is contained in:
parent
de32dbbd5d
commit
4d9c923ce7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12586
@ -334,14 +334,14 @@ print_filename (to_print, full_pathname)
|
||||
PUTX (*s);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
#else
|
||||
char *s, c, *new_full_pathname;
|
||||
int extension_char = 0, slen, tlen;
|
||||
|
||||
for (s = to_print; *s; s++)
|
||||
{
|
||||
PUTX (*s);
|
||||
}
|
||||
}
|
||||
|
||||
if (rl_filename_completion_desired && rl_visible_stats)
|
||||
{
|
||||
@ -468,7 +468,7 @@ rl_complete_internal (what_to_do)
|
||||
}
|
||||
}
|
||||
|
||||
if (rl_point == end && found_quote == 0)
|
||||
if (rl_point == end && quote_char == '\0')
|
||||
{
|
||||
int quoted = 0;
|
||||
/* We didn't find an unclosed quoted substring upon which to do
|
||||
@ -633,7 +633,16 @@ rl_complete_internal (what_to_do)
|
||||
munge the array, deleting matches as it desires. */
|
||||
if (rl_ignore_some_completions_function &&
|
||||
our_func == (Function *)filename_completion_function)
|
||||
(void)(*rl_ignore_some_completions_function)(matches);
|
||||
{
|
||||
(void)(*rl_ignore_some_completions_function)(matches);
|
||||
if (matches == 0 || matches[0] == 0)
|
||||
{
|
||||
if (matches)
|
||||
free (matches);
|
||||
ding ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we are doing completion on quoted substrings, and any matches
|
||||
contain any of the completer_word_break_characters, then auto-
|
||||
|
@ -166,7 +166,7 @@ static int visible_first_line_len = 0;
|
||||
\002 (^B) end non-visible characters
|
||||
all characters except \001 and \002 (following a \001) are copied to
|
||||
the returned string; all characters except those between \001 and
|
||||
\002 are assumed to be `visible'. */
|
||||
\002 are assumed to be `visible'. */
|
||||
|
||||
static char *
|
||||
expand_prompt (pmt, lp)
|
||||
@ -187,7 +187,7 @@ expand_prompt (pmt, lp)
|
||||
|
||||
l = pmt ? strlen (pmt) : 0;
|
||||
r = ret = xmalloc (l + 1);
|
||||
|
||||
|
||||
for (rl = ignoring = 0, p = pmt; p && *p; p++)
|
||||
{
|
||||
/* This code strips the invisible character string markers
|
||||
@ -377,7 +377,7 @@ rl_redisplay ()
|
||||
out += 4;
|
||||
}
|
||||
else
|
||||
line[out++] = c;
|
||||
line[out++] = c;
|
||||
}
|
||||
#if defined (DISPLAY_TABS)
|
||||
else if (c == '\t')
|
||||
@ -693,7 +693,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
if (old[0] && new[0])
|
||||
old[0] = new[0];
|
||||
}
|
||||
|
||||
|
||||
/* Find first difference. */
|
||||
for (ofd = old, nfd = new;
|
||||
(ofd - old < omax) && *ofd && (*ofd == *nfd);
|
||||
|
@ -161,7 +161,7 @@ stripwhite (string)
|
||||
|
||||
for (s = string; whitespace (*s); s++)
|
||||
;
|
||||
|
||||
|
||||
if (*s == 0)
|
||||
return (s);
|
||||
|
||||
|
@ -56,7 +56,7 @@ invert_case_line (count, key)
|
||||
}
|
||||
else
|
||||
direction = 1;
|
||||
|
||||
|
||||
/* Find the end of the range to modify. */
|
||||
end = start + (count * direction);
|
||||
|
||||
|
@ -170,7 +170,7 @@ rl_add_funmap_entry (name, function)
|
||||
else
|
||||
funmap =
|
||||
(FUNMAP **)xrealloc (funmap, (funmap_size += 80) * sizeof (FUNMAP *));
|
||||
|
||||
|
||||
funmap[funmap_entry] = (FUNMAP *)xmalloc (sizeof (FUNMAP));
|
||||
funmap[funmap_entry]->name = name;
|
||||
funmap[funmap_entry]->function = function;
|
||||
|
@ -332,6 +332,8 @@ history_search_internal (string, direction, anchored)
|
||||
reverse = (direction < 0);
|
||||
|
||||
/* Take care of trivial cases first. */
|
||||
if (string == 0 || *string == '\0')
|
||||
return (-1);
|
||||
|
||||
if (!history_length || ((i == history_length) && !reverse))
|
||||
return (-1);
|
||||
@ -862,7 +864,7 @@ history_set_pos (pos)
|
||||
history_offset = pos;
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
@ -996,7 +998,7 @@ get_history_event (string, caller_index, delimiting_quote)
|
||||
{
|
||||
entry = current_history ();
|
||||
history_offset = history_length;
|
||||
|
||||
|
||||
/* If this was a substring search, then remember the
|
||||
string that we matched for word substitution. */
|
||||
if (substring_okay)
|
||||
@ -1259,7 +1261,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
|
||||
quoted_search_delimiter = string[i - 1];
|
||||
event = get_history_event (string, &i, quoted_search_delimiter);
|
||||
}
|
||||
|
||||
|
||||
if (!event)
|
||||
{
|
||||
*ret_string = hist_error (string, start, i, EVENT_NOT_FOUND);
|
||||
@ -1581,7 +1583,7 @@ history_expand (hstring, output)
|
||||
*output = savestring (hstring);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/* Prepare the buffer for printing error messages. */
|
||||
result = xmalloc (result_len = 256);
|
||||
result[0] = '\0';
|
||||
@ -1650,7 +1652,7 @@ history_expand (hstring, output)
|
||||
}
|
||||
#endif /* SHELL */
|
||||
}
|
||||
|
||||
|
||||
if (string[i] != history_expansion_char)
|
||||
{
|
||||
free (result);
|
||||
@ -1968,7 +1970,7 @@ history_tokenize_internal (string, wind, indp)
|
||||
return (result);
|
||||
|
||||
start = i;
|
||||
|
||||
|
||||
if (member (string[i], "()\n"))
|
||||
{
|
||||
i++;
|
||||
|
@ -67,7 +67,7 @@ extern HIST_ENTRY **history_list ();
|
||||
/* Returns the number which says what history element we are now
|
||||
looking at. */
|
||||
extern int where_history ();
|
||||
|
||||
|
||||
/* Return the history entry at the current position, as determined by
|
||||
history_offset. If there is no entry there, return a NULL pointer. */
|
||||
HIST_ENTRY *current_history ();
|
||||
|
@ -114,7 +114,7 @@
|
||||
/*
|
||||
* POSIX 1003.1 5.6.1.2 <sys/stat.h> File Modes
|
||||
*/
|
||||
|
||||
|
||||
#if !defined (S_IRWXU)
|
||||
# if !defined (S_IREAD)
|
||||
# define S_IREAD 00400
|
||||
|
@ -216,12 +216,12 @@ int _rl_horizontal_scroll_mode = 0;
|
||||
|
||||
/* Non-zero means to display an asterisk at the starts of history lines
|
||||
which have been modified. */
|
||||
int _rl_mark_modified_lines = 0;
|
||||
int _rl_mark_modified_lines = 0;
|
||||
|
||||
/* The style of `bell' notification preferred. This can be set to NO_BELL,
|
||||
AUDIBLE_BELL, or VISIBLE_BELL. */
|
||||
int _rl_bell_preference = AUDIBLE_BELL;
|
||||
|
||||
|
||||
/* Line buffer and maintenence. */
|
||||
char *rl_line_buffer = (char *)NULL;
|
||||
int rl_line_buffer_len = 0;
|
||||
@ -995,15 +995,15 @@ readline_initialize_everything ()
|
||||
t = getenv ("LC_CTYPE");
|
||||
t1 = getenv ("LANG");
|
||||
if (t && (strstr (t, "8859-1") != NULL || strstr (t, "8859_1") != NULL ||
|
||||
strstr (t, "KOI8-R") != NULL || strstr (t, "koi8-r") != NULL) ||
|
||||
strstr (t, "KOI8-R") != NULL || strstr (t, "koi8-r") != NULL) ||
|
||||
t1 && (strstr (t1, "8859-1") != NULL || strstr (t1, "8859_1") != NULL ||
|
||||
strstr (t1, "KOI8-R") != NULL || strstr (t1, "koi8-r") != NULL))
|
||||
strstr (t1, "KOI8-R") != NULL || strstr (t1, "koi8-r") != NULL))
|
||||
{
|
||||
_rl_meta_flag = 1;
|
||||
_rl_convert_meta_chars_to_ascii = 0;
|
||||
_rl_output_meta_chars = 1;
|
||||
}
|
||||
|
||||
|
||||
/* Read in the init file. */
|
||||
rl_read_init_file ((char *)NULL);
|
||||
|
||||
@ -2110,7 +2110,7 @@ rl_quoted_insert (count, key)
|
||||
int c;
|
||||
|
||||
c = rl_read_key ();
|
||||
return (rl_insert (count, c));
|
||||
return (rl_insert (count, c));
|
||||
}
|
||||
|
||||
/* Insert a tab character. */
|
||||
@ -2224,7 +2224,7 @@ rl_delete (count, invoking_key)
|
||||
}
|
||||
else
|
||||
return (rl_delete_text (rl_point, rl_point + 1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Delete all spaces and tabs around point. */
|
||||
|
@ -162,7 +162,7 @@ extern char *rl_basic_word_break_characters;
|
||||
extern char *rl_completer_word_break_characters;
|
||||
|
||||
/* List of characters which can be used to quote a substring of the line.
|
||||
Completion occurs on the entire substring, and within the substring
|
||||
Completion occurs on the entire substring, and within the substring
|
||||
rl_completer_word_break_characters are treated as any other character,
|
||||
unless they also appear within this list. */
|
||||
extern char *rl_completer_quote_characters;
|
||||
|
@ -23,7 +23,7 @@
|
||||
# include <string.h>
|
||||
#else /* !HAVE_STRING_H */
|
||||
# include <strings.h>
|
||||
#endif /* !HAVE_STRING_H */
|
||||
#endif /* !HAVE_STRING_H */
|
||||
|
||||
#if defined (HAVE_STDLIB_H)
|
||||
# include <stdlib.h>
|
||||
|
@ -174,7 +174,7 @@ rl_vi_redo (count, c)
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/* Yank the nth arg from the previous line into this line at point. */
|
||||
rl_vi_yank_arg (count, key)
|
||||
int count, key;
|
||||
@ -886,7 +886,7 @@ rl_vi_delete (count, key)
|
||||
end = rl_end;
|
||||
|
||||
rl_kill_text (rl_point, end);
|
||||
|
||||
|
||||
if (rl_point > 0 && rl_point == rl_end)
|
||||
rl_backward (1);
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user