]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20150220 snapshot
authorChet Ramey <chet.ramey@case.edu>
Mon, 23 Feb 2015 21:29:18 +0000 (16:29 -0500)
committerChet Ramey <chet.ramey@case.edu>
Mon, 23 Feb 2015 21:29:18 +0000 (16:29 -0500)
CWRU/CWRU.chlog
arrayfunc.c
builtins/declare.def
lib/glob/smatch.c
lib/readline/doc/rltech.texi
lib/readline/doc/version.texi
lib/sh/shmatch.c
variables.c

index b49d3e38fa4989a68dfd36cc41657f24be957a74..d22b48ae0c03dd0d3abbc9dd39725ad4cd5ee5a3 100644 (file)
@@ -7999,3 +7999,41 @@ include/posixjmp.h
 lib/readline/util.c
        - change calls to longjmp to use _rl_longjmp
 
+                                  2/18
+                                  ----
+variables.c
+       - bind_int_variable: make sure `v' is non-null before making it visible
+
+                                  2/19
+                                  ----
+arrayfunc.c
+       - assign_array_var_from_word_list: after assignment, mark variable as no
+         longer invisible
+       - assign_array_var_from_string: after assignment, mark variable as no
+         longer invisible
+
+builtins/declare.def
+       - declare_internal: add warning if an attempt is made to use a quoted
+         compound assignment as an argument to declare (declare -a foo='( 1 2 )');
+         backwards compatible with bash-4.3. Still a tentative change
+
+                                  2/20
+                                  ----
+lib/glob/smatch.c
+       - is_wcclass: check malloc() return value, return -1 if it fails
+         Report from Tobias Stoeckmann <tobias@stoeckmann.org>
+
+lib/sh/shmatch.c
+       - sh_regmatch: check malloc() return value, handle NULL value if it
+         fails.  Report from Tobias Stoeckmann <tobias@stoeckmann.org>
+
+                                  2/22
+                                  ----
+lib/readline/doc/rltech.texi
+       - rl_callback_handler_install: note that the handler function should
+         free the line it receives, as with readline.  Suggested by
+         Ulf Magnusson <ulfalizer@gmail.com>
+       - Readline Signal Handling: note that application needs to clean up
+         readline's terminal state if it wants to handle a signal before
+         the line handler restores it.  Suggested by Ulf Magnusson
+         <ulfalizer@gmail.com>
index c2ea0e5f1989c4539f03fc8b53406ac114b6a1fd..6dab71ca6a6832f52b890365b46946b43a93e35d 100644 (file)
@@ -407,6 +407,9 @@ assign_array_var_from_word_list (var, list, flags)
       (*var->assign_func) (var, l->word->word, i, 0);
     else
       array_insert (a, i, l->word->word);
+
+  VUNSETATTR (var, att_invisible);     /* no longer invisible */
+
   return var;
 }
 
@@ -639,6 +642,10 @@ assign_array_var_from_string (var, value, flags)
 
   if (nlist)
     dispose_words (nlist);
+
+  if (var)
+    VUNSETATTR (var, att_invisible);   /* no longer invisible */
+
   return (var);
 }
 
index bdff891d8ec1c8366fa7b2c9120d897529d280df..79d7a0c75cabdd5d838d0986c1413a217f6e145f 100644 (file)
@@ -567,11 +567,13 @@ declare_internal (list, local_var)
              int vlen;
              vlen = STRLEN (value);
 /*itrace("declare_builtin: name = %s value = %s flags = %d", name, value, wflags);*/
-#if 0  /* bash-4.4 */
-             if (value[0] == '(' && value[vlen-1] == ')' && (shell_compatibility_level <= 43 || (wflags & W_COMPASSIGN)))
-#else
-             if (array_exists == 0 && value[0] == '(' && value[vlen-1] == ')')
-#endif
+             if (shell_compatibility_level > 43 && (wflags & W_COMPASSIGN) == 0 &&
+                       value[0] == '(' && value[vlen-1] == ')')
+               {
+                 internal_warning (_("%s: quoted compound array assignment deprecated"), list->word->word);
+                 compound_array_assign = 1;
+               }
+             else if (value[0] == '(' && value[vlen-1] == ')' && (shell_compatibility_level < 44 || (wflags & W_COMPASSIGN)))
                compound_array_assign = 1;
              else
                simple_array_assign = 1;
index 6ebe8c3b481326a6c30c2a0ea9537143656d6fb2..edc5b95d0c2880211f4026df512b4dd7a2c6e60e 100644 (file)
@@ -334,6 +334,8 @@ is_wcclass (wc, name)
 
   memset (&state, '\0', sizeof (mbstate_t));
   mbs = (char *) malloc (wcslen(name) * MB_CUR_MAX + 1);
+  if (mbs == 0)
+    return -1;
   mbslength = wcsrtombs (mbs, (const wchar_t **)&name, (wcslen(name) * MB_CUR_MAX + 1), &state);
 
   if (mbslength == (size_t)-1 || mbslength == (size_t)-2)
index cfbca3f63ebf1845a69c4a33ac2492725f815856..2fd0b943d318a09fca56e94c70559a496ee50b73 100644 (file)
@@ -1307,6 +1307,8 @@ expanded value of @var{prompt}.  Save the value of @var{lhandler} to
 use as a handler function to call when a complete line of input has been
 entered.
 The handler function receives the text of the line as an argument.
+As with @code{readline()}, the handler function should @code{free} the
+line when it it finished with it.
 @end deftypefun
 
 @deftypefun void rl_callback_read_char (void)
@@ -1532,7 +1534,14 @@ resetting the terminal to its original state.  If the application's signal
 handler does more than update its idea of the terminal size and return (for
 example, a @code{longjmp} back to a main processing loop), it @emph{must}
 call @code{rl_cleanup_after_signal()} (described below), to restore the
-terminal state. 
+terminal state.
+
+When an application is using the callback interface
+(@pxref{Alternate Interface}), Readline installs signal handlers only for
+the duration of the call to @code{rl_callback_read_char}.  Applications
+using the callback interface should be prepared to clean up Readline's
+state if they wish to handle the signal before the line handler completes
+and restores the terminal state.
 
 Readline provides two variables that allow application writers to
 control whether or not it will catch certain signals and act on them
index 351faa08fdeb356c639d1ad09f5f6f32cde0cb50..0f75ecb743fcbe8fb317a67a854fb912498cd9e0 100644 (file)
@@ -1,10 +1,10 @@
 @ignore
-Copyright (C) 1988-2014 Free Software Foundation, Inc. 
+Copyright (C) 1988-2015 Free Software Foundation, Inc. 
 @end ignore
 
-@set EDITION 6.3
-@set VERSION 6.3
-@set UPDATED 21 November 2014
-@set UPDATED-MONTH November 2014
+@set EDITION 6.4
+@set VERSION 6.4
+@set UPDATED 22 February 2015
+@set UPDATED-MONTH February 2015
 
-@set LASTCHANGE Fri Nov 21 08:07:14 EST 2014
+@set LASTCHANGE Sun Feb 22 20:32:36 EST 2015
index 3abefed581601efcc775b59afa495c55b8d73930..fcd228ef2bfb5c82db40fd77cc8c18693980ffda 100644 (file)
@@ -2,7 +2,7 @@
  * shmatch.c -- shell interface to posix regular expression matching.
  */
 
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2015 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -79,7 +79,8 @@ sh_regmatch (string, pattern, flags)
   matches = NULL;
 #endif
 
-  if (regexec (&regex, string, regex.re_nsub + 1, matches, 0))
+  /* man regexec: NULL PMATCH ignored if NMATCH == 0 */
+  if (regexec (&regex, string, matches ? regex.re_nsub + 1 : 0, matches, 0))
     result = EXECUTION_FAILURE;
   else
     result = EXECUTION_SUCCESS;                /* match */
@@ -95,7 +96,7 @@ sh_regmatch (string, pattern, flags)
   rematch = make_new_array_variable ("BASH_REMATCH");
   amatch = array_cell (rematch);
 
-  if ((flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str)
+  if (matches && (flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str)
     {
       for (subexp_ind = 0; subexp_ind <= regex.re_nsub; subexp_ind++)
        {
index 2f07ebb92abab975ee64e919df1c3ff604ae6c54..cbe780637166f30e56bbb0b7d7ce700aaa0fbd29 100644 (file)
@@ -2872,10 +2872,12 @@ bind_int_variable (lhs, rhs)
 #endif
     v = bind_variable (lhs, rhs, 0);
 
-  if (v && isint)
-    VSETATTR (v, att_integer);
-
-  VUNSETATTR (v, att_invisible);
+  if (v)
+    {
+      if (isint)
+       VSETATTR (v, att_integer);
+      VUNSETATTR (v, att_invisible);
+    }
 
   return (v);
 }