i. There is a default value for $BASH_LOADABLES_PATH in config-top.h.
j. Associative array assignment and certain instances of referencing (e.g.,
- `test -v' now allow `@' and `*' to be used as keys.
+ `test -v') now allow `@' and `*' to be used as keys.
-k. Bash attempts to expand indexed array subscripts only once when executing
- shell constructs and word expansions.
+k. Bash attempts to expand indexed and associative array subscripts only
+ once when executing shell constructs and word expansions.
l. The `unset' builtin allows a subscript of `@' or `*' to unset a key with
that value for associative arrays instead of unsetting the entire array
i. There is a default value for $BASH_LOADABLES_PATH in config-top.h.
j. Associative array assignment and certain instances of referencing (e.g.,
- `test -v' now allow `@' and `*' to be used as keys.
+ `test -v') now allow `@' and `*' to be used as keys.
-k. Bash attempts to expand indexed array subscripts only once when executing
- shell constructs and word expansions.
+k. Bash attempts to expand indexed and associative array subscripts only
+ once when executing shell constructs and word expansions.
l. The `unset' builtin allows a subscript of `@' or `*' to unset a key with
that value for associative arrays instead of unsetting the entire array
printed an informational message to that effect even when writing
output in a format that can be reused as input (-l). Bash-5.1
suppresses that message if -l is supplied
+ - Bash-5.1 and later use pipes for here-documents and here-strings if
+ they are smaller than the pipe capacity. If the shell compatibility
+ level is set to 50 or lower, it reverts to using temporary files.
compat51 (set using BASH_COMPAT)
- The `unset' builtin will unset the array a given an argument like
for statement can be expanded more than once
- expressions used as arguments to arithmetic operators in the [[
conditional command can be expanded more than once
+ - indexed and associative array subscripts used as arguments to the
+ operators in the [[ conditional command (e.g., `[[ -v') can be
+ expanded more than once. Bash-5.2 behaves as if the
+ `assoc_expand_once' option were enabled.
- the expressions in substring parameter brace expansion can be
expanded more than once
- the expressions in the $(( ... )) word expansion can be expanded
- parameter_brace_expand: when expanding an indirect variable, extend
the special case for array[@] and array[*] (set -u/no positional
parameters, obeying the baroque quoting rules) to the value of the
- indirection. Report amd fix from konsolebox <konsolebox@gmail.com>
+ indirection. Report and fix from konsolebox <konsolebox@gmail.com>
12/31
-----
lib/sh/zgetline.c
- zgetline: use size_t instead of int for local length and indexing
variables
+
+ 4/20
+ ----
+pcomplete.c
+ - init_itemlist_from_varlist: free VLIST after assigning it from
+ *SVFUNC and after we get the variable names and values out of it.
+ Report from Robert E. Griffith <bobg@junga.com>
+
+ 4/25
+ ----
+redir.c
+ - here_document_to_fd: if the shell compatibility level is bash-5.0 or
+ earlier, use tempfiles for all here-documents and here-strings. From
+ a bug-bash discussion started by Sam Liddicott <sam@liddicott.com>
+
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
+#include <locale.h>
#if defined (HAVE_STRING_H)
# include <string.h>
@{
char *line, *s;
+ setlocale (LC_ALL, "");
+
progname = argv[0];
initialize_readline (); /* Bind our completer. */
#include <stdio.h>
#include <termios.h> /* xxx - should make this more general */
+#include <locale.h>
+
#ifdef READLINE_LIBRARY
# include "readline.h"
#else
{
fd_set fds;
+ setlocale (LC_ALL, "");
+
/* Adjust the terminal slightly before the handler is installed. Disable
* canonical mode processing and set the input character time flag to be
* non-blocking.
# include <readline/history.h>
#endif
+#include <unistd.h>
+#include <stdlib.h>
#include <string.h>
+int
main (argc, argv)
int argc;
char **argv;
#include <sys/types.h>
#include <sys/select.h>
+#include <signal.h>
+
#include <errno.h>
#include <stdio.h>
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
/* Standard readline include files. */
#if defined (READLINE_LIBRARY)
# include "readline.h"
extern int errno;
static void cb_linehandler (char *);
+static void signandler (int);
-int running;
+int running, sigwinch_received;
const char *prompt = "rltest$ ";
+/* Handle SIGWINCH and window size changes when readline is not active and
+ reading a character. */
+static void
+sighandler (int sig)
+{
+ sigwinch_received = 1;
+}
+
/* Callback function called for each line when accept-line executed, EOF
seen, or EOF character read. This sets a flag and returns; it could
also call exit(3). */
fd_set fds;
int r;
+ setlocale (LC_ALL, "");
+
+ /* Handle SIGWINCH */
+ signal (SIGWINCH, sighandler);
+
/* Install the line handler. */
rl_callback_handler_install (prompt, cb_linehandler);
rl_callback_handler_remove ();
break;
}
+ if (sigwinch_received)
+ {
+ rl_resize_terminal ();
+ sigwinch_received = 0;
+ }
+ if (r < 0)
+ continue;
if (FD_ISSET (fileno (rl_instream), &fds))
rl_callback_read_char ();
#include <signal.h>
+#include <locale.h>
#include <stdio.h>
/* Standard readline include files. */
{
char *p;
+ setlocale (LC_ALL, "");
+
running = 1;
rl_catch_signals = 1;
extern void exit();
#endif
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
#if defined (READLINE_LIBRARY)
# include "posixstat.h"
# include "readline.h"
else
progname++;
+#ifdef HAVE_SETLOCALE
+ setlocale (LC_ALL, "");
+#endif
+
/* defaults */
prompt = "readline$ ";
fd = nch = 0;
extern void exit();
#endif
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
#ifndef errno
extern int errno;
#endif
char *temp;
int opt, Vflag, Nflag;
+#ifdef HAVE_SETLOCALE
+ setlocale (LC_ALL, ""):
+#endif
+
progname = strrchr(argv[0], '/');
if (progname == 0)
progname = argv[0];
#include <signal.h>
-#if 0 /* LINUX */
+#if 1 /* LINUX */
#include <pty.h>
#else
#include <util.h>
#endif
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
#ifdef READLINE_LIBRARY
# include "readline.h"
#else
exit (0);
}
+void
+sigwinch (s)
+ int s;
+{
+ rl_resize_terminal ();
+}
+
static int
user_input()
{
main()
{
int val;
+
+#ifdef HAVE_SETLOCALE
+ setlocale (LC_ALL, "");
+#endif
+
val = openpty (&masterfd, &slavefd, NULL, NULL, NULL);
if (val == -1)
return -1;
if (val == -1)
return -1;
+ signal (SIGWINCH, sigwinch);
+ signal (SIGINT, sigint);
+
val = init_readline (slavefd, slavefd);
if (val == -1)
return -1;
if (val == -1)
return -1;
- signal (SIGINT, sigint);
-
val = main_loop ();
tty_reset (STDIN_FILENO);
extern void exit();
#endif
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
#ifdef READLINE_LIBRARY
# include "readline.h"
# include "history.h"
char *temp, *prompt;
int done;
+#ifdef HAVE_SETLOCALE
+ setlocale (LC_ALL, "");
+#endif
+
temp = (char *)NULL;
prompt = "readline$ ";
done = 0;
sl->list[i] = savestring (vlist[i]->name);
sl->list[sl->list_len = n] = (char *)NULL;
itp->slist = sl;
+ free (vlist);
}
static int
return fd;
}
-#if defined (HEREDOC_PIPESIZE)
+ if (shell_compatibility_level <= 50)
+ goto use_tempfile;
+
+#if HEREDOC_PIPESIZE
/* Try to use a pipe internal to this process if the document is shorter
than the system's pipe capacity (computed at build time). We want to
write the entire document without write blocking. */
to the != or == operator, and should be treated as a pattern. In
this case, we quote the string specially for the globbing code. If
SPECIAL is 2, this is an rhs argument for the =~ operator, and should
- be quoted appropriately for regcomp/regexec. The caller is responsible
+ be quoted appropriately for regcomp/regexec. If SPECIAL is 3, this is
+ an array subscript and should be quoted after expansion so it's only
+ expanded once (Q_ARITH). The caller is responsible
for removing the backslashes if the unquoted word is needed later. In
any case, since we don't perform word splitting, we need to do quoted
null character removal. */