execute_cmd.c
- execute_connection: call optimize_fork on the rhs of a `;' connection
to attempt to optimize the last simple command in a list
+
+ 3/4
+ ---
+subst.c
+ - parameter_brace_expand: add `@' to the list of operators that cause
+ unbound parameter errors. Fixes oversight bug reported by
+ Martin Schulte <gnu@schrader-schulte.de>
+
+ 3/5
+ ---
+subst.c
+ - expand_word_internal: update to fix from 2/21 and 2/27 to accommodate
+ contexts when word splitting will not take place (W_ASSIGNRHS). Fix
+ from Grisha Levit <grishalevit@gmail.com>
+ - param_expand: if IFS is unset, and we are expanding $* in a context
+ where we're not going to be performing word splitting, just treat it
+ as if IFS=" " and don't set W_SPLITSPACE. Report and hint at fix
+ from Grisha Levit <grishalevit@gmail.com>
+ - param_expand: if IFS is not null, and we are expanding $* in a
+ context where we're not going to be performing word splitting, and
+ we quote a null string (resulting in a quoted null), make sure we
+ set W_SAWQUOTEDNULL to note this for the caller
+ - parameter_brace_expand_rhs: make sure to remove any W_SAWQUOTEDNULL
+ flag for a the word on the rhs of the `=' operator if the original
+ string is null or the original string is not null and the returned
+ string (after dequoting) is not null. For instance ${v= ''} should
+ not have the SAWQUOTEDNULL flag set because it is " " after
+ expansion and dequoting, even though we saw a quoted null there
tests/dollar-star7.sub f
tests/dollar-star8.sub f
tests/dollar-star9.sub f
+tests/dollar-star10.sub f
tests/dollar.right f
tests/dstack.tests f
tests/dstack.right f
in the consistency of user interface across discrete programs that need
to provide a command line interface.
-Copyright (C) 1988--2016 Free Software Foundation, Inc.
+Copyright (C) 1988--2019 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
If an application does not wish Readline to catch @code{SIGWINCH}, it may
call @code{rl_resize_terminal()} or @code{rl_set_screen_size()} to force
-Readline to update its idea of the terminal size when a @code{SIGWINCH}
-is received.
+Readline to update its idea of the terminal size when it receives
+a @code{SIGWINCH}.
@deftypefun void rl_echo_signal_char (int sig)
If an application wishes to install its own signal handlers, but still
Set Readline's idea of the terminal size to @var{rows} rows and
@var{cols} columns. If either @var{rows} or @var{columns} is less than
or equal to 0, Readline's idea of that terminal dimension is unchanged.
+This is intended to tell Readline the physical dimensions of the terminal,
+and is used internally to calculate the maximum number of characters that
+may appear on the screen.
@end deftypefun
If an application does not want to install a @code{SIGWINCH} handler, but
-is still interested in the screen dimensions, Readline's idea of the screen
-size may be queried.
+is still interested in the screen dimensions, it may query Readline's idea
+of the screen size.
@deftypefun void rl_get_screen_size (int *rows, int *cols)
Return Readline's idea of the terminal's size in the
@ignore
-Copyright (C) 1988-2018 Free Software Foundation, Inc.
+Copyright (C) 1988-2019 Free Software Foundation, Inc.
@end ignore
@set EDITION 8.0
@set VERSION 8.0
-@set UPDATED 30 November 2018
-@set UPDATED-MONTH November 2018
+@set UPDATED 6 March 2019
+@set UPDATED-MONTH March 2019
-@set LASTCHANGE Fri Nov 30 22:50:53 EST 2018
+@set LASTCHANGE Wed Mar 6 09:51:02 EST 2019
/* ``Have a little faith, there's magic in the night. You ain't a
beauty, but, hey, you're alright.'' */
-/* Copyright (C) 1987-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2019 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
splitting, we want to quote the value we return appropriately, like
the other expansions this function handles. */
w->word = (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) ? quote_string (t1) : quote_escapes (t1);
+ /* If we have something that's non-null, that's not a quoted null string,
+ and we're not going to be performing word splitting (we know we're not
+ because the operator is `='), we can forget we saw a quoted null. */
+ if (w->word && w->word[0] && QUOTED_NULL (w->word) == 0)
+ w->flags &= ~W_SAWQUOTEDNULL;
free (t1);
return w;
/* All the cases where an expansion can possibly generate an unbound
variable error. */
- if (want_substring || want_patsub || want_casemod || c == '#' || c == '%' || c == RBRACE)
+ if (want_substring || want_patsub || want_casemod || c == '@' || c == '#' || c == '%' || c == RBRACE)
{
if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1]) && all_element_arrayref == 0)
{
identical to $@ */
if (expand_no_split_dollar_star && quoted == 0 && ifs_is_set == 0 && (pflags & PF_ASSIGNRHS))
{
- /* Posix interp 888: RHS of assignment, IFS unset */
- temp = string_list_dollar_at (list, Q_DOUBLE_QUOTES, pflags);
- tflag |= W_SPLITSPACE;
+ /* Posix interp 888: RHS of assignment, IFS unset: no splitting,
+ separate with space */
+ temp1 = string_list_dollar_star (list, quoted, pflags);
+ temp = temp1 ? quote_string (temp1) : temp1;
+ /* XXX - tentative - note that we saw a quoted null here */
+ if (temp1 && *temp1 == 0 && QUOTED_NULL (temp))
+ tflag |= W_SAWQUOTEDNULL;
+ FREE (temp1);
}
else if (expand_no_split_dollar_star && quoted == 0 && ifs_is_null && (pflags & PF_ASSIGNRHS))
{
/* Posix interp 888: RHS of assignment, IFS set to non-null value */
temp1 = string_list_dollar_star (list, quoted, pflags);
temp = temp1 ? quote_string (temp1) : temp1;
+
+ /* XXX - tentative - note that we saw a quoted null here */
+ if (temp1 && *temp1 == 0 && QUOTED_NULL (temp))
+ tflag |= W_SAWQUOTEDNULL;
FREE (temp1);
}
/* XXX - should we check ifs_is_set here as well? */
this is when we are going to be performing word splitting,
since we have to preserve a null argument if the next character
will cause word splitting. */
- if (temp == 0 && quoted_state == PARTIALLY_QUOTED && quoted == 0 && (word->flags & W_NOSPLIT) == 0 && (word->flags & W_EXPANDRHS))
+ if (temp == 0 && quoted_state == PARTIALLY_QUOTED && quoted == 0 && (word->flags & (W_NOSPLIT|W_EXPANDRHS|W_ASSIGNRHS)) == W_EXPANDRHS)
{
c = CTLNUL;
sindex--;
partially quoted; such nulls are discarded. See above for the
exception, which is when the string is going to be split.
Posix interp 888/1129 */
- if (temp == 0 && quoted_state == PARTIALLY_QUOTED && quoted == 0 && (word->flags & W_NOSPLIT) == 0 && (word->flags & W_EXPANDRHS))
+ if (temp == 0 && quoted_state == PARTIALLY_QUOTED && quoted == 0 && (word->flags & (W_NOSPLIT|W_EXPANDRHS|W_ASSIGNRHS)) == W_EXPANDRHS)
{
c = CTLNUL;
sindex--;
# IFS is null
${THIS_SH} ./dollar-star9.sub
+# more tests for expansions of $* when not splitting with IFS set or unset and
+# null strings as the positional parameters
+${THIS_SH} ./dollar-star10.sub
+
exit 0
--- /dev/null
+oIFS=$IFS
+
+set -- ''
+
+unset v
+recho ${v= ''}
+recho $v
+unset v
+recho ${v=''}
+recho $v
+unset v
+recho ${v= $*}
+recho $v
+unset v
+recho ${v=$*}
+recho $v
+unset v
+recho ${v='' }
+recho $v
+unset v
+recho ${v= '' }
+recho $v
+unset v
+recho ${v=$* }
+recho $v
+unset v
+recho ${v= $* }
+recho $v
+
+unset IFS
+
+unset v
+recho ${v= ''}
+recho $v
+unset v
+recho ${v=''}
+recho $v
+unset v
+recho ${v= $*}
+recho $v
+unset v
+recho ${v=$*}
+recho $v
+unset v
+recho ${v='' }
+recho $v
+unset v
+recho ${v= '' }
+recho $v
+unset v
+recho ${v=$* }
+recho $v
+unset v
+recho ${v= $* }
+recho $v
+
+unset -v v
+IFS=$oIFS
+
+# This shouldn't output anything
+set -- '' ''
+
+unset -v v
+recho ${v=$*}
+unset -v v
+recho ${v= $*}
+unset -v v
+recho ${v=$* }
+unset -v v
+recho ${v= $* }
+
+unset -v v IFS
+recho ${v=$*}
+unset -v v
+recho ${v= $*}
+unset -v v
+recho ${v= $* }
+unset -v v
+recho ${v= $*}