bash-4.3-rc2 overlay

This commit is contained in:
Chet Ramey
2014-01-29 17:00:07 -05:00
parent 8581f42df9
commit b6e23235f2
144 changed files with 8686 additions and 5727 deletions
+3 -4
View File
@@ -748,10 +748,9 @@ rl_redisplay ()
/* Now account for invisible characters in the current line. */
/* XXX - this assumes that the invisible characters may be split, but only
between the first and the last lines. */
temp += ((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line
: ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line))
: ((newlines == 0) ? wrap_offset : 0));
temp += (newlines == 0) ? prompt_invis_chars_first_line
: ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line);
inv_lbreaks[++newlines] = temp;
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0)
+1 -1
View File
@@ -12,7 +12,7 @@ This document describes the GNU History library
a programming tool that provides a consistent user interface for
recalling lines of previously typed input.
Copyright @copyright{} 1988--2012 Free Software Foundation, Inc.
Copyright @copyright{} 1988--2014 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
+1 -1
View File
@@ -1,7 +1,7 @@
@ignore
This file documents the user interface to the GNU History library.
Copyright (C) 1988-2012 Free Software Foundation, Inc.
Copyright (C) 1988-2014 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
Permission is granted to make and distribute verbatim copies of this manual
+1 -1
View File
@@ -1,7 +1,7 @@
@ignore
This file documents the user interface to the GNU History library.
Copyright (C) 1988--2012 Free Software Foundation, Inc.
Copyright (C) 1988--2014 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
Permission is granted to make and distribute verbatim copies of this manual
+1 -1
View File
@@ -13,7 +13,7 @@ This manual describes the GNU Readline Library
consistency of user interface across discrete programs which provide
a command line interface.
Copyright @copyright{} 1988--2012 Free Software Foundation, Inc.
Copyright @copyright{} 1988--2014 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
+1 -1
View File
@@ -7,7 +7,7 @@ This document describes the GNU Readline Library, a utility for aiding
in the consistency of user interface across discrete programs that need
to provide a command line interface.
Copyright (C) 1988--2012 Free Software Foundation, Inc.
Copyright (C) 1988--2014 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
+11 -5
View File
@@ -9,7 +9,7 @@ use these features. There is a document entitled "readline.texinfo"
which contains both end-user and programmer documentation for the
GNU Readline Library.
Copyright (C) 1988--2012 Free Software Foundation, Inc.
Copyright (C) 1988--2014 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
@@ -1189,11 +1189,17 @@ as if the @samp{!$} history expansion had been specified.
@subsection Commands For Changing Text
@ftable @code
@item @i{end-of-file} (usually C-d)
The character indicating end-of-file as set, for example, by
@code{stty}. If this character is read when there are no characters
on the line, and point is at the beginning of the line, Readline
interprets it as the end of input and returns @sc{eof}.
@item delete-char (C-d)
Delete the character at point. If point is at the
beginning of the line, there are no characters in the line, and
the last character typed was not bound to @code{delete-char}, then
return @sc{eof}.
Delete the character at point. If this function is bound to the
same character as the tty @sc{eof} character, as @kbd{C-d}
commonly is, see above for the effects.
@item backward-delete-char (Rubout)
Delete the character behind the cursor. A numeric argument means
+1 -1
View File
@@ -12,7 +12,7 @@ This manual describes the end user interface of the GNU Readline Library
consistency of user interface across discrete programs which provide
a command line interface.
Copyright @copyright{} 1988--2012 Free Software Foundation, Inc.
Copyright @copyright{} 1988--2014 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
+4 -4
View File
@@ -1,10 +1,10 @@
@ignore
Copyright (C) 1988-2013 Free Software Foundation, Inc.
Copyright (C) 1988-2014 Free Software Foundation, Inc.
@end ignore
@set EDITION 6.3
@set VERSION 6.3
@set UPDATED 26 May 2013
@set UPDATED-MONTH May 2013
@set UPDATED 6 January 2014
@set UPDATED-MONTH January 2014
@set LASTCHANGE Sat May 25 17:02:56 EDT 2013
@set LASTCHANGE Mon Jan 6 16:26:51 EST 2014
+2
View File
@@ -272,6 +272,8 @@ get_history_event (string, caller_index, delimiting_quote)
if (local_index == 0 || substring_okay)
{
entry = current_history ();
if (entry == 0)
FAIL_SEARCH ();
history_offset = history_length;
/* If this was a substring search, then remember the
+18 -2
View File
@@ -283,7 +283,9 @@ get_funky_string (char **dest, const char **src, bool equals_end, size_t *output
default:
/* should we ? */
abort ();
/* abort (); no, we should not */
state = ST_ERROR;
break;
}
}
@@ -387,7 +389,16 @@ void _rl_parse_colors()
}
}
if (state == -1)
_rl_errmsg ("LS_COLORS: unrecognized prefix: %s", label);
{
_rl_errmsg ("LS_COLORS: unrecognized prefix: %s", label);
/* recover from an unrecognized prefix */
while (p && *p && *p != ':')
p++;
if (p && *p == ':')
state = 1;
else if (p && *p == 0)
state = 0;
}
}
break;
@@ -400,6 +411,9 @@ void _rl_parse_colors()
}
else
state = -1;
/* XXX - recover here as with an unrecognized prefix? */
if (state == -1 && ext->ext.string)
_rl_errmsg ("LS_COLORS: syntax error: %s", ext->ext.string);
break;
}
}
@@ -417,6 +431,8 @@ void _rl_parse_colors()
e = e->next;
free (e2);
}
_rl_color_ext_list = NULL;
_rl_colored_stats = 0; /* can't have colored stats without colors */
}
#else /* !COLOR_SUPPORT */
;
+3 -2
View File
@@ -172,7 +172,8 @@ noninc_dosearch (string, dir)
oldpos = where_history ();
history_set_pos (noninc_history_pos);
entry = current_history ();
entry = current_history (); /* will never be NULL after successful search */
#if defined (VI_MODE)
if (rl_editing_mode != vi_mode)
#endif
@@ -477,7 +478,7 @@ rl_history_search_internal (count, dir)
rl_history_search_pos = ret;
oldpos = where_history ();
history_set_pos (rl_history_search_pos);
temp = current_history ();
temp = current_history (); /* will never be NULL after successful search */
history_set_pos (oldpos);
/* Don't find multiple instances of the same line. */
+1 -1
View File
@@ -260,7 +260,7 @@ _rl_handle_signal (sig)
# endif /* HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
rl_reset_after_signal ();
rl_reset_after_signal ();
}
RL_UNSETSTATE(RL_STATE_SIGHANDLER);
+13
View File
@@ -178,6 +178,7 @@ rl_do_undo ()
{
UNDO_LIST *release;
int waiting_for_begin, start, end;
HIST_ENTRY *cur, *temp;
#define TRANS(i) ((i) == -1 ? rl_point : ((i) == -2 ? rl_end : (i)))
@@ -232,6 +233,18 @@ rl_do_undo ()
release = rl_undo_list;
rl_undo_list = rl_undo_list->next;
/* If we are editing a history entry, make sure the change is replicated
in the history entry's line */
cur = current_history ();
if ((UNDO_LIST *)cur->data == release)
{
temp = replace_history_entry (where_history (), rl_line_buffer, (histdata_t)rl_undo_list);
xfree (temp->line);
FREE (temp->timestamp);
xfree (temp);
}
replace_history_data (-1, (histdata_t *)release, (histdata_t *)rl_undo_list);
xfree (release);
+1 -1
View File
@@ -92,7 +92,7 @@ CSOURCES = clktck.c clock.c getcwd.c getenv.c oslib.c setlinebuf.c \
mktime.c strftime.c mbschr.c zcatfd.c zmapfd.c winsize.c eaccess.c \
wcsdup.c fpurge.c zgetline.c mbscmp.c uconvert.c ufuncs.c \
casemod.c dprintf.c input_avail.c mbscasecmp.c fnxform.c \
strchrnul.c unicode.c wcswidth.c wcsnwidth.c shmbchar.c
strchrnul.c unicode.c wcswidth.c wcsnwidth.c shmbchar.c strdup.c
# The header files for this library.
HSOURCES =
+12
View File
@@ -50,6 +50,18 @@ itos (i)
return (savestring (p));
}
/* Integer to string conversion. This conses the string using strdup;
caller should free it and be prepared to deal with NULL return. */
char *
mitos (i)
intmax_t i;
{
char *p, lbuf[INT_STRLEN_BOUND(intmax_t) + 1];
p = fmtumax (i, 10, lbuf, sizeof(lbuf), 0);
return (strdup (p));
}
char *
uinttostr (i, buf, len)
uintmax_t i;
+42
View File
@@ -0,0 +1,42 @@
/* strdup - return a copy of a string in newly-allocated memory. */
/* Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Bash is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
/* Get specification. */
#include <string.h>
#include <stdlib.h>
/* Duplicate S, returning an identical malloc'd string. */
char *
strdup (s)
const char *s;
{
size_t len;
void *new;
len = strlen (s) + 1;
if ((new = malloc (len)) == NULL)
return NULL;
memcpy (new, s, len);
return ((char *)new);
}
+16
View File
@@ -40,6 +40,14 @@ strvec_create (n)
return ((char **)xmalloc ((n) * sizeof (char *)));
}
/* Allocate an array of strings with room for N members. */
char **
strvec_mcreate (n)
int n;
{
return ((char **)malloc ((n) * sizeof (char *)));
}
char **
strvec_resize (array, nsize)
char **array;
@@ -48,6 +56,14 @@ strvec_resize (array, nsize)
return ((char **)xrealloc (array, nsize * sizeof (char *)));
}
char **
strvec_mresize (array, nsize)
char **array;
int nsize;
{
return ((char **)realloc (array, nsize * sizeof (char *)));
}
/* Return the length of ARRAY, a NULL terminated array of char *. */
int
strvec_len (array)