]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20091029 snapshot
authorChet Ramey <chet.ramey@case.edu>
Fri, 9 Dec 2011 01:19:23 +0000 (20:19 -0500)
committerChet Ramey <chet.ramey@case.edu>
Fri, 9 Dec 2011 01:19:23 +0000 (20:19 -0500)
12 files changed:
COMPAT
CWRU/CWRU.chlog
MANIFEST
builtins/mapfile.def
builtins/shopt.def
configure.in
doc/bash.1
doc/bashref.texi
mailcheck.c
shell.c
support/shobj-conf
test.c

diff --git a/COMPAT b/COMPAT
index 63940e6d7ebd69d0cda4374b3a9f252e931a4ad4..ec68c2faff4cd25701686cfb1d632aec896a4c4d 100644 (file)
--- a/COMPAT
+++ b/COMPAT
@@ -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
+
index f06b996ce99774fd135bae01793078018a1adb9d..0392f2406fd4d34181d7cc5cfc645a982a9aeff9 100644 (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>
index c8d5c2e157e3e8f2e50b4d53706e544a58d4bf15..e42d7d70e32dac798349fcdb3fc7e31a7dcd16d8 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -38,6 +38,7 @@ support               d
 tests          d
 tests/misc     d
 ABOUT-NLS      f
+ChangeLog      s       CWRU/changelog
 CHANGES                f
 COMPAT         f
 COPYING                f
index bd71a14ef8fe892470fa089a4db62cc3b2229d8c..0946de3ee1b57d6358260130e8cf3eed84acd231 100644 (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);
index 643558194cb1bb3786cca4a843cc02401732b9e1..71a2b6e2483922ae0735ed3dd7e75a104d64916d 100644 (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;
index 0d61ceb50c406f3b376b6e014ec0fa2969fcaab1..65864107bd25e789e315ad2fa02d3b99444ae095 100644 (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])
 
index 0c3cdf95fcd9f05b8a1ace4b728de01fda17ec36..f124704d95e452c97773a2728b7deee593c9dde1 100644 (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
index e53a8163dac819129a06f6790f0310010401a6cd..f36be6c9fad250e382e260d8f20e24c06931d255 100644 (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.
 
index ed64bdfb3995a09cff0d635ef12c5c7c55813d8a..bd95f0d6dca7c15597f0ece62d9c2a410e781c26 100644 (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);
 }
diff --git a/shell.c b/shell.c
index 6e650cea7e787c818e35e2d3e4c4e74b39b1dca8..87feb14290e4b6a59f0eee12f466a6b82ce9fd31 100644 (file)
--- a/shell.c
+++ b/shell.c
@@ -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;
index 084a7414b9dc4af4195f2d5bf8ce39fcbb170d75..5a63e80aa9f5d65d1ec8401feef47a9d6618e1f8 100644 (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}'
 
diff --git a/test.c b/test.c
index 206c9cf5e7ceaf4367c17430dd3ca8c81609849a..180940c9ca9b4eff08d8256e7b72d31cd409111b 100644 (file)
--- a/test.c
+++ b/test.c
@@ -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));