summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-12-03 00:09:12 +0000
committerache <ache@FreeBSD.org>1995-12-03 00:09:12 +0000
commit275c944c8419bf5baf4c5e582306e2526bca03fd (patch)
tree449997b4dde43d2d8e1704879a871e687e20a7af /gnu
parentdb52077e7d8d67f5fcf7eac6dfc7e5f660027512 (diff)
downloadFreeBSD-src-275c944c8419bf5baf4c5e582306e2526bca03fd.zip
FreeBSD-src-275c944c8419bf5baf4c5e582306e2526bca03fd.tar.gz
Add fixes from bash beta
Back out trailing spaces changes
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/libreadline/complete.c17
-rw-r--r--gnu/lib/libreadline/display.c8
-rw-r--r--gnu/lib/libreadline/examples/fileman.c2
-rw-r--r--gnu/lib/libreadline/examples/manexamp.c2
-rw-r--r--gnu/lib/libreadline/funmap.c2
-rw-r--r--gnu/lib/libreadline/history.c14
-rw-r--r--gnu/lib/libreadline/history.h2
-rw-r--r--gnu/lib/libreadline/posixstat.h2
-rw-r--r--gnu/lib/libreadline/readline.c14
-rw-r--r--gnu/lib/libreadline/readline.h2
-rw-r--r--gnu/lib/libreadline/tilde.c2
-rw-r--r--gnu/lib/libreadline/vi_mode.c4
12 files changed, 41 insertions, 30 deletions
diff --git a/gnu/lib/libreadline/complete.c b/gnu/lib/libreadline/complete.c
index 2ef001c..f219877 100644
--- a/gnu/lib/libreadline/complete.c
+++ b/gnu/lib/libreadline/complete.c
@@ -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-
diff --git a/gnu/lib/libreadline/display.c b/gnu/lib/libreadline/display.c
index 762b505..daf736c 100644
--- a/gnu/lib/libreadline/display.c
+++ b/gnu/lib/libreadline/display.c
@@ -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);
diff --git a/gnu/lib/libreadline/examples/fileman.c b/gnu/lib/libreadline/examples/fileman.c
index 3256bf3..3ecb9f1 100644
--- a/gnu/lib/libreadline/examples/fileman.c
+++ b/gnu/lib/libreadline/examples/fileman.c
@@ -161,7 +161,7 @@ stripwhite (string)
for (s = string; whitespace (*s); s++)
;
-
+
if (*s == 0)
return (s);
diff --git a/gnu/lib/libreadline/examples/manexamp.c b/gnu/lib/libreadline/examples/manexamp.c
index 051dcbc..3496efa 100644
--- a/gnu/lib/libreadline/examples/manexamp.c
+++ b/gnu/lib/libreadline/examples/manexamp.c
@@ -56,7 +56,7 @@ invert_case_line (count, key)
}
else
direction = 1;
-
+
/* Find the end of the range to modify. */
end = start + (count * direction);
diff --git a/gnu/lib/libreadline/funmap.c b/gnu/lib/libreadline/funmap.c
index c37cf39..9255974 100644
--- a/gnu/lib/libreadline/funmap.c
+++ b/gnu/lib/libreadline/funmap.c
@@ -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;
diff --git a/gnu/lib/libreadline/history.c b/gnu/lib/libreadline/history.c
index 7c23143..94c0ad5 100644
--- a/gnu/lib/libreadline/history.c
+++ b/gnu/lib/libreadline/history.c
@@ -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++;
diff --git a/gnu/lib/libreadline/history.h b/gnu/lib/libreadline/history.h
index d9d4131..6935efd 100644
--- a/gnu/lib/libreadline/history.h
+++ b/gnu/lib/libreadline/history.h
@@ -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 ();
diff --git a/gnu/lib/libreadline/posixstat.h b/gnu/lib/libreadline/posixstat.h
index ce123f8..7d1cece 100644
--- a/gnu/lib/libreadline/posixstat.h
+++ b/gnu/lib/libreadline/posixstat.h
@@ -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
diff --git a/gnu/lib/libreadline/readline.c b/gnu/lib/libreadline/readline.c
index 577f536..59fbc32 100644
--- a/gnu/lib/libreadline/readline.c
+++ b/gnu/lib/libreadline/readline.c
@@ -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. */
diff --git a/gnu/lib/libreadline/readline.h b/gnu/lib/libreadline/readline.h
index 8132843..652d8ca 100644
--- a/gnu/lib/libreadline/readline.h
+++ b/gnu/lib/libreadline/readline.h
@@ -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;
diff --git a/gnu/lib/libreadline/tilde.c b/gnu/lib/libreadline/tilde.c
index bfdc80e..736f1e6 100644
--- a/gnu/lib/libreadline/tilde.c
+++ b/gnu/lib/libreadline/tilde.c
@@ -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>
diff --git a/gnu/lib/libreadline/vi_mode.c b/gnu/lib/libreadline/vi_mode.c
index 8ace892..d0b9310 100644
--- a/gnu/lib/libreadline/vi_mode.c
+++ b/gnu/lib/libreadline/vi_mode.c
@@ -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);
OpenPOWER on IntegriCloud