commit bash-20091029 snapshot

This commit is contained in:
Chet Ramey
2011-12-08 20:19:23 -05:00
parent b06e584e05
commit 6bf8a8a76a
12 changed files with 94 additions and 18 deletions
+37 -7
View File
@@ -1,10 +1,12 @@
Compatibility with previous versions
====================================
This document details the incompatibilities between this version of bash,
bash-4.0, and the previous widely-available versions, bash-1.14 (which is
still the `standard' version for a few Linux distributions) and bash-2.x.
bash-4.1, and the previous widely-available versions, bash-2.x (which is
still the `standard' version for a few Linux distributions) and bash-3.x.
These were discovered by users of bash-2.x and 3.x, so this list is not
comprehensive. Some of these incompatibilities occur between the current
version and versions 2.0 and above. (The differences between bash-1.14 and
bash-2.0 were significant.)
version and versions 2.0 and above.
1. Bash uses a new quoting syntax, $"...", to do locale-specific
string translation. Users who have relied on the (undocumented)
@@ -277,7 +279,8 @@ bash-2.0 were significant.)
than a regular expression.
34. Bash-4.0 allows the behavior in the previous item to be modified using
the notion of a shell `compatibility level'.
the notion of a shell `compatibility level'. If the compat31 shopt
option is set, quoting the pattern has no special effect.
35. Bash-3.2 (patched) and Bash-4.0 fix a bug that leaves the shell in an
inconsistent internal state following an assignment error. One of the
@@ -311,7 +314,8 @@ bash-2.0 were significant.)
41. Beginning with bash-4.0, when one of the commands in a pipeline is killed
by a SIGINT while executing a command list, the shell acts as if it
received the interrupt.
received the interrupt. This can be disabled by setting the compat31 or
compat32 shell options.
42. Bash-4.0 changes the handling of the set -e option so that the shell exits
if a pipeline fails (and not just if the last command in the failing
@@ -325,4 +329,30 @@ bash-2.0 were significant.)
case.
44. Bash-4.1 uses the current locale when comparing strings using the < and
> operators to the `[[' command.
> operators to the `[[' command. This can be reverted to the previous
behavior by setting one of the `compatNN' shopt options.
Shell Compatibility Level
=========================
Bash-3.2 introduced the concept of a `shell compatibility level', specified
as a set of options to the shopt builtin (compat31, compat32, compat40 at
this writing). There is only one current compatibility level -- each
option is mutually exclusive.
compat31 set
- the < and > operators to the [[ command do not consider the current
locale when comparing strings
compat32 set
- the < and > operators to the [[ command do not consider the current
locale when comparing strings
- quoting the rhs of the regexp matching operator (=~) has no
special effect
compat40 set
- the < and > operators to the [[ command do not consider the current
locale when comparing strings
- interrupting a command list such as "a ; b ; c" causes the execution
of the entire list to be aborted
+35
View File
@@ -9095,3 +9095,38 @@ lib/readline/complete.c
- in insert_match, skip over a close quote in the replacement text if
the character at point when completion is invoked is a single
quote. Fixes complaint from bash-bugs@atu.cjb.net
10/26
-----
shell.c
- in main, make sure "$EMACS" is non-null before calling strstr on its
value. Fixes Red Hat bug 530911 submitted by Mitchell Berger
builtins/mapfile.def
- don't save callback commands in shell history. Suggested by
Jan Schampera <jan.schampera@web.de>
mailcheck.c
- in file_mod_date_changed, make sure the modification time is later
than the saved modification date, not just that it's not equal.
Fix from Evgeniy Dushistov <dushistov@mail.ru>
- in file_access_date_changed, make sure the access time is later
than the saved access time, not just that it's not equal
10/27
-----
builtins/shopt.def
- added new `compat40' compatibility variable, with associated changes
to shell_compatibility_level(), since the default compatibility level
is now 41
test.c
- make the < and > operators to [[ use strcoll() only if the shell
compatibility level is greater than 40 (it is 41 by default in
bash-4.1)
10/28
-----
support/shobj-conf
- decrease the default version of FreeBSD that creates shared libraries
to 4.x. Advice from Peter Jeremy <peterjeremy@acm.org>
+1
View File
@@ -38,6 +38,7 @@ support d
tests d
tests/misc d
ABOUT-NLS f
ChangeLog s CWRU/changelog
CHANGES f
COMPAT f
COPYING f
+2 -2
View File
@@ -112,10 +112,10 @@ run_callback(callback, current_index)
execlen += 2;
execstr = xmalloc (execlen);
flags = 0;
flags = SEVAL_NOHIST;
#if 0
if (interactive)
flags |= SEVAL_NOHIST|SEVAL_INTERACT;
flags |= SEVAL_INTERACT;
#endif
snprintf (execstr, execlen, "%s %d", callback, current_index);
return parse_and_execute(execstr, NULL, flags);
+3
View File
@@ -145,6 +145,7 @@ static struct {
#endif
{ "compat31", &shopt_compat31, set_compatibility_level },
{ "compat32", &shopt_compat32, set_compatibility_level },
{ "compat40", &shopt_compat40, set_compatibility_level },
#if defined (READLINE)
{ "dirspell", &dircomplete_spelling, (shopt_set_func_t *)NULL },
#endif
@@ -502,6 +503,8 @@ set_compatibility_level (mode)
shell_compatibility_level = 31;
else if (shopt_compat32)
shell_compatibility_level = 32;
else if (shopt_compat40)
shell_compatibility_level = 40;
else
shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
return 0;
+2 -2
View File
@@ -21,10 +21,10 @@ dnl Process this file with autoconf to produce a configure script.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Bash 4.1, version 4.015])dnl
AC_REVISION([for Bash 4.1, version 4.016])dnl
define(bashvers, 4.1)
define(relstatus, alpha)
define(relstatus, beta)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
+4
View File
@@ -3820,6 +3820,10 @@ descriptor 0, 1, or 2, respectively, is checked.
.PP
Unless otherwise specified, primaries that operate on files follow symbolic
links and operate on the target of the link, rather than the link itself.
.if t .sp 0.5
.if n .sp 1
When used with \fB[[\fP, The \fB<\fP and \fB>\fP operators sort
lexicographically using the current locale.
.sp 1
.PD 0
.TP
+3
View File
@@ -5716,6 +5716,9 @@ If the @var{file} argument to one of the primaries is one of
@file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file
descriptor 0, 1, or 2, respectively, is checked.
When used with @samp{[[}, The @samp{<} and @samp{>} operators sort
lexicographically using the current locale.
Unless otherwise specified, primaries that operate on files follow symbolic
links and operate on the target of the link, rather than the link itself.
+2 -2
View File
@@ -268,7 +268,7 @@ file_mod_date_changed (i)
mtime = mailfiles[i]->mod_time;
if ((mailstat (file, &finfo) == 0) && (finfo.st_size > 0))
return (mtime != finfo.st_mtime);
return (mtime < finfo.st_mtime);
if (finfo.st_size == 0 && mailfiles[i]->file_size > 0)
UPDATE_MAIL_FILE (i, finfo);
@@ -289,7 +289,7 @@ file_access_date_changed (i)
atime = mailfiles[i]->access_time;
if ((mailstat (file, &finfo) == 0) && (finfo.st_size > 0))
return (atime != finfo.st_atime);
return (atime < finfo.st_atime);
return (0);
}
+1 -1
View File
@@ -574,7 +574,7 @@ main (argc, argv, env)
/* running_under_emacs == 2 for `eterm' */
running_under_emacs = (emacs != 0) || (term && STREQN (term, "emacs", 5));
running_under_emacs += term && STREQN (term, "eterm", 5) && strstr (emacs, "term");
running_under_emacs += term && STREQN (term, "eterm", 5) && emacs && strstr (emacs, "term");
if (running_under_emacs)
gnu_error_format = 1;
+3 -3
View File
@@ -128,7 +128,7 @@ freebsd2*)
;;
# FreeBSD-3.x ELF
freebsd[3-6]*|freebsdelf[3-6]*|freebsdaout[3-6]*|dragonfly*)
freebsd3*|freebsdaout*)
SHOBJ_CFLAGS=-fPIC
SHOBJ_LD='${CC}'
@@ -145,8 +145,8 @@ freebsd[3-6]*|freebsdelf[3-6]*|freebsdaout[3-6]*|dragonfly*)
fi
;;
# FreeBSD-7.x and later have only ELF
freebsd[7-9]*|freebsdelf[7-9]*)
# FreeBSD-4.x and later have only ELF
freebsd[4-9]*|freebsdelf*|dragonfly*)
SHOBJ_CFLAGS=-fPIC
SHOBJ_LD='${CC}'
+1 -1
View File
@@ -378,7 +378,7 @@ binary_test (op, arg1, arg2, flags)
return (patmatch ? patcomp (arg1, arg2, EQ) : STREQ (arg1, arg2));
else if ((op[0] == '>' || op[0] == '<') && op[1] == '\0')
{
if (flags & TEST_LOCALE)
if (shell_compatibility_level > 40 && flags & TEST_LOCALE)
return ((op[0] == '>') ? (strcoll (arg1, arg2) > 0) : (strcoll (arg1, arg2) < 0));
else
return ((op[0] == '>') ? (strcmp (arg1, arg2) > 0) : (strcmp (arg1, arg2) < 0));