]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20091022 snapshot
authorChet Ramey <chet.ramey@case.edu>
Fri, 9 Dec 2011 01:18:59 +0000 (20:18 -0500)
committerChet Ramey <chet.ramey@case.edu>
Fri, 9 Dec 2011 01:18:59 +0000 (20:18 -0500)
17 files changed:
COMPAT
CWRU/CWRU.chlog
CWRU/CWRU.chlog~
MANIFEST
MANIFEST~
NEWS
README
bashline.c
bashline.c~
builtins/evalfile.c
lib/readline/complete.c
lib/readline/complete.c~
lib/sh/fnxform.c
tests/RUN-ONE-TEST
tests/exec.right
tests/execscript
tests/redir8.sub

diff --git a/COMPAT b/COMPAT
index c635c8a1385232ac1ae6e48a9862f3a398b7668e..63940e6d7ebd69d0cda4374b3a9f252e931a4ad4 100644 (file)
--- a/COMPAT
+++ b/COMPAT
@@ -323,3 +323,6 @@ bash-2.0 were significant.)
     search the current directory for its filename argument, even if "." is
     not in $PATH.  Posix says that the shell shouldn't look in $PWD in this
     case.
+
+44. Bash-4.1 uses the current locale when comparing strings using the < and
+    > operators to the `[[' command.
index 4e80baf431c5de7bef5e5457b2390be88816c814..f06b996ce99774fd135bae01793078018a1adb9d 100644 (file)
@@ -9071,3 +9071,27 @@ builtins/evalstring.c
          indicating a parse error, print a warning message if the conditions
          would require  a posix-mode shell to abort (parse error in a `.'
          script or eval string)
+
+                                  10/19
+                                  -----
+builtins/evalfile.c
+       - even if the `check binary' flag is not passed to _evalfile, return an
+         error after reading 128 null characters if called by `source', on
+         the assumption that it's probably a binary file.  [This will be in
+         bash-4.1-beta]
+
+                                  10/24
+                                  -----
+[bash-4.1-alpha released]
+
+bashline.c
+       - don't call command_substitution_completion_function if we're
+         completing a substring delimited by a single quote.  Fixes bug
+         reported by bash-bugs@atu.cjb.net
+
+lib/readline/complete.c
+       - make sure _rl_skip_completed_text defaults to 0, as the
+         documentation states (incorrect in bash-4.1-alpha)
+       - 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
index 7cb641080dacc98f5334755823840676949de9dc..cb8e985bb0fa237a68cc41b00009fdc6a40cff8c 100644 (file)
@@ -9049,8 +9049,8 @@ parse.y
 execute_cmd.c
        - in execute_in_subshell, make sure we set setjmp(return_catch) before
          running the command, in case the command or its word expansion
-         calls jump_to_top_level.  Fixes bug reported by Enrique Perez-Terron
-         <enrio@online.no>
+         calls jump_to_top_level.  Fixes bug reported by Nils Bernhard
+         <nils.bernhard@yahoo.de>
 
 subst.c
        - new PF_NOSPLIT2 flag for param_expand
@@ -9071,3 +9071,27 @@ builtins/evalstring.c
          indicating a parse error, print a warning message if the conditions
          would require  a posix-mode shell to abort (parse error in a `.'
          script or eval string)
+
+                                  10/19
+                                  -----
+builtins/evalfile.c
+       - even if the `check binary' flag is not passed to _evalfile, return an
+         error after reading 128 null characters if called by `source', on
+         the assumption that it's probably a binary file.  [This will be in
+         bash-4.1-beta]
+
+                                  10/24
+                                  -----
+[bash-4.1-alpha released]
+
+bashline.c
+       - don't call command_substitution_completion_function if we're
+         completing a substring delimited by a single quote.  Fixes bug
+         reported by bash-bugs@atu.cjb.net
+
+lib/readline/complete.c
+       - make sure _rl_skip_completed_text defaults to 0, as the
+         documentation states (incorrect in bash-4.1-alpha)
+       - 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
index 284dd0e0f55d0084c2dde54be2db5d173dbae15c..c8d5c2e157e3e8f2e50b4d53706e544a58d4bf15 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -488,6 +488,8 @@ po/fi.gmo           f
 po/fi.po               f
 po/fr.gmo              f
 po/fr.po               f
+po/ga.gmo              f
+po/ga.po               f
 po/hu.gmo              f
 po/hu.po               f
 po/id.gmo              f
index 707c7a734b33dac216b61f8a66b708214d8f4ff0..284dd0e0f55d0084c2dde54be2db5d173dbae15c 100644 (file)
--- a/MANIFEST~
+++ b/MANIFEST~
@@ -833,6 +833,7 @@ tests/exp.tests             f
 tests/exp.right                f
 tests/exp1.sub         f
 tests/exp2.sub         f
+tests/exp3.sub         f
 tests/extglob.tests    f
 tests/extglob.right    f
 tests/extglob1.sub     f
diff --git a/NEWS b/NEWS
index 05573cca69e6d39e0ef98437bc39a96a4e96f1da..e7e02054bbbaf6bc2cba6e3af661c92f08ce0664 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,114 @@
+This is a terse description of the new features added to bash-4.1 since
+the release of bash-4.0.  As always, the manual page (doc/bash.1) is
+the place to look for complete descriptions.
+
+1.  New Features in Bash
+
+a.  Here-documents within $(...) command substitutions may once more be
+    delimited by the closing right paren, instead of requiring a newline.
+
+b.  Bash's file status checks (executable, readable, etc.) now take file
+    system ACLs into account on file systems that support them.
+
+c.  Bash now passes environment variables with names that are not valid
+    shell variable names through into the environment passed to child
+    processes.
+
+d.  The `execute-unix-command' readline function now attempts to clear and
+    reuse the current line rather than move to a new one after the command
+    executes.
+
+e.  `printf -v' can now assign values to array indices.
+
+f.  New `complete -E' and `compopt -E' options that work on the "empty"
+    completion: completion attempted on an empty command line.
+
+g.  New complete/compgen/compopt -D option to define a `default' completion:
+    a completion to be invoked on command for which no completion has been
+    defined.  If this function returns 124, programmable completion is
+    attempted again, allowing a user to dynamically build a set of completions
+    as completion is attempted by having the default completion function
+    install individual completion functions each time it is invoked.
+
+h.  When displaying associative arrays, subscripts are now quoted.
+
+i.  Changes to dabbrev-expand to make it more `emacs-like': no space appended
+    after matches, completions are not sorted, and most recent history entries
+    are presented first.
+
+j.  The [[ and (( commands are now subject to the setting of `set -e' and the
+    ERR trap.
+
+k.  The source/. builtin now removes NUL bytes from the file before attempting
+    to parse commands.
+
+l.  There is a new configuration option (in config-top.h) that forces bash to
+    forward all history entries to syslog.
+
+m.  A new variable $BASHOPTS to export shell options settable using `shopt' to
+    child processes.
+
+n.  There is a new confgure option that forces the extglob option to be
+    enabled by default.
+
+o.  New variable $BASH_XTRACEFD; when set to an integer bash will write xtrace
+    output to that file descriptor.
+
+p.  If the optional left-hand-side of a redirection is of the form {var}, the
+    shell assigns the file descriptor used to $var or uses $var as the file
+    descriptor to move or close, depending on the redirection operator.
+
+q.  The < and > operators to the [[ conditional command now do string
+    comparison according to the current locale.
+
+r.  Programmable completion now uses the completion for `b' instead of `a'
+    when completion is attempted on a line like: a $(b c.
+
+s.  Force extglob on temporarily when parsing the pattern argument to
+    the == and != operators to the [[ command, for compatibility.
+
+t.  Changed the behavior of interrupting the wait builtin when a SIGCHLD is
+    received and a trap on SIGCHLD is set to be Posix-mode only.
+
+u.  The read builtin has a new `-N nchars' option, which reads exactly NCHARS
+    characters, ignoring delimiters like newline.
+
+2.  New Features in Readline
+
+a.  New bindable function: menu-complete-backward.
+
+b.  In the vi insertion keymap, C-n is now bound to menu-complete by default,
+    and C-p to menu-complete-backward.
+
+c.  When in vi command mode, repeatedly hitting ESC now does nothing, even
+    when ESC introduces a bound key sequence.  This is closer to how
+    historical vi behaves.
+
+d.  New bindable function: skip-csi-sequence.  Can be used as a default to
+    consume key sequences generated by keys like Home and End without having
+    to bind all keys.
+
+e.  New application-settable function: rl_filename_rewrite_hook.  Can be used
+    to rewite or modify filenames read from the file system before they are
+    compared to the word to be completed.
+
+f.  New bindable variable: skip-completed-text, active when completing in the
+    middle of a word.  If enabled, it means that characters in the completion
+    that match characters in the remainder of the word are "skipped" rather
+    than inserted into the line.
+
+g.  The pre-readline-6.0 version of menu completion is available as
+    "old-menu-complete" for users who do not like the readline-6.0 version.
+
+h.  New bindable variable: echo-control-characters.  If enabled, and the
+    tty ECHOCTL bit is set, controls the echoing of characters corresponding
+    to keyboard-generated signals.
+
+i.  New bindable variable: enable-meta-key.  Controls whether or not readline
+    sends the smm/rmm sequences if the terminal indicates it has a meta key
+    that enables eight-bit characters.
+
+-------------------------------------------------------------------------------
 This is a terse description of the new features added to bash-4.0 since
 the release of bash-3.2.  As always, the manual page (doc/bash.1) is
 the place to look for complete descriptions.
diff --git a/README b/README
index 2d43cea62284fdee3ff22dacc0d7dbe276fadf52..73bb5f3de524a546f33070dc9e34e04b85ac823e 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 Introduction
 ============
 
-This is GNU Bash, version 4.0.  Bash is the GNU Project's Bourne
+This is GNU Bash, version 4.1.  Bash is the GNU Project's Bourne
 Again SHell, a complete implementation of the POSIX.2 shell spec,
 but also with interactive command line editing, job control on
 architectures that support it, csh-like features such as history
index d7a309c6f6305dd91ee77b42dba10d0ddebc7dd9..7658771ebb18a0e4fbab743cb244c777c46ee873 100644 (file)
@@ -1315,8 +1315,9 @@ attempt_shell_completion (text, start, end)
   /* Special handling for command substitution.  If *TEXT is a backquote,
      it can be the start or end of an old-style command substitution, or
      unmatched.  If it's unmatched, both calls to unclosed_pair will
-     succeed.  */
-  if (*text == '`' && 
+     succeed.  Don't bother if readline found a single quote and we are
+     completing on the substring.  */
+  if (*text == '`' && rl_completion_quote_character != '\'' &&
        (in_command_position || (unclosed_pair (rl_line_buffer, start, "`") &&
                                 unclosed_pair (rl_line_buffer, end, "`"))))
     matches = rl_completion_matches (text, command_subst_completion_function);
index 1e0f8e3d6fc6a2cfa37dc24bffaf087d8af80d67..d7a309c6f6305dd91ee77b42dba10d0ddebc7dd9 100644 (file)
@@ -1197,7 +1197,7 @@ find_cmd_start (start)
   register int s, os;
 
   os = 0;
-  while (((s = skip_to_delim (rl_line_buffer, os, COMMAND_SEPARATORS, SD_NOJMP)) <= start) &&
+  while (((s = skip_to_delim (rl_line_buffer, os, COMMAND_SEPARATORS, SD_NOJMP|SD_NOSKIPCMD)) <= start) &&
         rl_line_buffer[s])
     os = s+1;
   return os;
index 1b6b8c94fed29f0c0c7543782a07b21827b97534..972d03932989600fa3f06cd8db57b011d67165fc 100644 (file)
@@ -81,7 +81,7 @@ _evalfile (filename, flags)
 {
   volatile int old_interactive;
   procenv_t old_return_catch;
-  int return_val, fd, result, pflags, i;
+  int return_val, fd, result, pflags, i, nnull;
   ssize_t nr;                  /* return value from read(2) */
   char *string;
   struct stat finfo;
@@ -189,11 +189,20 @@ file_error_and_exit:
   i = strlen (string);
   if (i < nr)
     {
-      for (i = 0; i < nr; i++)
+      for (nnull = i = 0; i < nr; i++)
        if (string[i] == '\0')
           {
            memmove (string+i, string+i+1, nr - i);
            nr--;
+           /* Even if the `check binary' flag is not set, we want to avoid
+              sourcing files with more than 256 null characters -- that
+              probably indicates a binary file. */
+           if ((flags & FEVAL_BUILTIN) && ++nnull > 256)
+             {
+               free (string);
+               (*errfunc) (_("%s: cannot execute binary file"), filename);
+               return ((flags & FEVAL_BUILTIN) ? EX_BINARY_FILE : -1);
+             }
           }
     }
 
index ea2c864de63bc5e8910314416be6e39d8c52c04e..9ba54268bb27e92a8460513c561fc261fe36813a 100644 (file)
@@ -183,7 +183,7 @@ int rl_visible_stats = 0;
    characters from the match that match characters following point in
    the word.  This means, for instance, completing when the cursor is
    after the `e' in `Makefile' won't result in `Makefilefile'. */
-int _rl_skip_completed_text = 1;
+int _rl_skip_completed_text = 0;
 
 /* If non-zero, then this is the address of a function to call when
    completing on a directory name.  The function is called with
@@ -1570,7 +1570,7 @@ insert_match (match, start, mtype, qc)
 {
   char *replacement, *r;
   char oqc;
-  int end;
+  int end, rlen;
 
   oqc = qc ? *qc : '\0';
   replacement = make_quoted_replacement (match, mtype, qc);
@@ -1578,6 +1578,7 @@ insert_match (match, start, mtype, qc)
   /* Now insert the match. */
   if (replacement)
     {
+      rlen = strlen (replacement);
       /* Don't double an opening quote character. */
       if (qc && *qc && start && rl_line_buffer[start - 1] == *qc &&
            replacement[0] == *qc)
@@ -1588,6 +1589,9 @@ insert_match (match, start, mtype, qc)
            replacement[0] != oqc)
        start--;
       end = rl_point - 1;
+      /* Don't double a closing quote character */
+      if (qc && *qc && end && rl_line_buffer[rl_point] == *qc && replacement[rlen - 1] == *qc)
+        end++;
       if (_rl_skip_completed_text)
        {
          r = replacement;
index 0aa714f90c0340c7288ee18113b61a4cca7147d6..913c8dec1ac8236f40ca5c8186f43a720eb0afa2 100644 (file)
@@ -183,7 +183,7 @@ int rl_visible_stats = 0;
    characters from the match that match characters following point in
    the word.  This means, for instance, completing when the cursor is
    after the `e' in `Makefile' won't result in `Makefilefile'. */
-int _rl_skip_completed_text = 1;
+int _rl_skip_completed_text = 0;
 
 /* If non-zero, then this is the address of a function to call when
    completing on a directory name.  The function is called with
@@ -1570,7 +1570,7 @@ insert_match (match, start, mtype, qc)
 {
   char *replacement, *r;
   char oqc;
-  int end, ostart;
+  int end;
 
   oqc = qc ? *qc : '\0';
   replacement = make_quoted_replacement (match, mtype, qc);
@@ -2226,12 +2226,12 @@ rl_filename_completion_function (text, state)
 }
 
 /* An initial implementation of a menu completion function a la tcsh.  The
-   first time (if the last readline command was not rl_menu_complete), we
+   first time (if the last readline command was not rl_old_menu_complete), we
    generate the list of matches.  This code is very similar to the code in
    rl_complete_internal -- there should be a way to combine the two.  Then,
    for each item in the list of matches, we insert the match in an undoable
    fashion, with the appropriate character appended (this happens on the
-   second and subsequent consecutive calls to rl_menu_complete).  When we
+   second and subsequent consecutive calls to rl_old_menu_complete).  When we
    hit the end of the match list, we restore the original unmatched text,
    ring the bell, and reset the counter to zero. */
 int
@@ -2251,7 +2251,7 @@ rl_old_menu_complete (count, invoking_key)
 
   /* The first time through, we generate the list of matches and set things
      up to insert them. */
-  if (rl_last_func != rl_menu_complete)
+  if (rl_last_func != rl_old_menu_complete)
     {
       /* Clean up from previous call, if any. */
       FREE (orig_text);
index 55281b0a62a9bf6a3b0c28ad446151bd3ec757d6..499b9cb9d867909ab9961f09dec78f86007903dc 100644 (file)
@@ -185,7 +185,6 @@ char *
 fnx_tofs (string)
      char *string;
 {
-bar
   return string;
 }
 
index 72ec06a2c1fd8dde92acea5e8ac773e35f1d061b..3efcf32d68e9722024b6ca9d67f9e81b2aa5ac04 100755 (executable)
@@ -1,4 +1,4 @@
-BUILD_DIR=/usr/local/build/bash/bash-current
+BUILD_DIR=/usr/local/build/chet/bash/bash-current
 THIS_SH=$BUILD_DIR/bash
 PATH=$PATH:$BUILD_DIR
 
index 8f974ae59745147abbf813b3ca2f957c3d8d7df9..2146d4720d653f0bcbb827e70ae7b1b65837bc5c 100644 (file)
@@ -16,17 +16,17 @@ after exec1.sub without args: 0
 126
 ./execscript: line 46: .: /: is a directory
 1
-127
+126
 0
 this is bashenv
 ./exec3.sub: line 3: /tmp/bash-notthere: No such file or directory
 ./exec3.sub: line 3: exec: /tmp/bash-notthere: cannot execute: No such file or directory
 126
-./execscript: line 68: notthere: No such file or directory
+./execscript: line 70: notthere: No such file or directory
 127
-./execscript: line 71: notthere: No such file or directory
+./execscript: line 73: notthere: No such file or directory
 127
-./execscript: line 74: notthere: No such file or directory
+./execscript: line 76: notthere: No such file or directory
 127
 this is sh
 this is sh
index 5e11e235d8d521e544945088807290f23d28b1b3..3629c57a90899b2ee10cbe8ae03b2fab9a06dade 100644 (file)
@@ -48,6 +48,8 @@ echo $?
 
 # try sourcing a binary file -- post-2.04 versions don't do the binary file
 # check, and will probably fail with `command not found', or status 127
+# bash-4.1 and later check for 256 NUL characters and fail as binary files
+# if there are more than that, it's probably binary
 . ${THIS_SH} 2>/dev/null
 echo $?
 
index 7990a4afb45bc8aee3f6ee94bb36895235475b57..5f972a14d922da50fda99b4cea826342ecab1914 100644 (file)
@@ -1,3 +1,4 @@
+cd ${TMPDIR:=/var/tmp}
 rm -f u
 
 ${THIS_SH} -c 'exec 10>&1; echo fd 10 >&10' 10>u