commit bash-20210112 snapshot

This commit is contained in:
Chet Ramey
2021-01-15 14:39:20 -05:00
parent 63706353d7
commit a9cf0031ef
9 changed files with 58 additions and 15 deletions
+26
View File
@@ -9315,3 +9315,29 @@ doc/{bash.1,bashref.texi}
locale.c
- local_shiftstates -> locale_shiftsates in the non-multibyte code
branch. Reported by Henry Bent <henry.r.bent@gmail.com>
subst.c
- expand_compound_assignment_word: make sure to call dispose_words on
the WORD_LIST * returned from expand_oneword after turning it back
into a string. Fixes memory leak reported by Alexander Mescheryakov
<alexander.s.m@gmail.com>
1/13
----
variables.c
- bind_variable_internal: when performing an assignment to a subscripted
array variable that was the value of a nameref (used in the original
assignment), don't call make_variable_value on the value, since that
messes up +=. Just call assign_array_element and let that take care
of calling make_variable_value appropriately. Fixes bug reported by
Oguz <oguzismailuysal@gmail.com>
1/14
----
findcmd.c
- search_for_command: if `checkhash' is set, don't add non-executable
files to the command hash table, since we will just remove them
later
lib/sh/winsize.c
- get_new_window_size: set *rp and *cp even if READLINE is not defined
+1 -1
View File
@@ -1,6 +1,6 @@
/* arrayfunc.c -- High-level array functions used by other parts of the shell. */
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
/* Copyright (C) 2001-2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+6 -5
View File
@@ -1,6 +1,6 @@
/* execute_cmd.c -- Execute a COMMAND structure. */
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
/* Copyright (C) 1987-2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -3013,10 +3013,11 @@ eval_arith_for_expr (l, okp)
int r;
char *expr, *temp;
#if 0 /* TAG: bash-5.2 */
expr = l->next ? string_list (l) : savestring (l->word->word);
#if 1 /* TAG: bash-5.2 */
expr = l->next ? string_list (l) : l->word->word;
temp = expand_arith_string (expr, Q_DOUBLE_QUOTES|Q_ARITH);
free (expr);
if (l->next)
free (expr);
new = make_word_list (make_word (temp), (WORD_LIST *)NULL);
free (temp);
#else
@@ -3796,6 +3797,7 @@ execute_arith_command (arith_command)
exp = new->word->word;
exp = expand_arith_string (exp, Q_DOUBLE_QUOTES|Q_ARITH);
FREE (t);
/* If we're tracing, make a new word list with `((' at the front and `))'
at the back and print it. Change xtrace_print_arith_cmd to take a string
@@ -3818,7 +3820,6 @@ execute_arith_command (arith_command)
expresult = 0;
expok = 1;
}
FREE (t);
if (expok == 0)
return (EXECUTION_FAILURE);
+1 -1
View File
@@ -399,7 +399,7 @@ search_for_command (pathname, flags)
}
/* If we're in posix mode, don't add files without the execute bit
to the hash table. */
else if (posixly_correct)
else if (posixly_correct || check_hashed_filenames)
{
st = file_status (command);
if (st & FS_EXECABLE)
+1 -1
View File
@@ -88,11 +88,11 @@ get_new_window_size (from_sig, rp, cp)
sh_set_lines_and_columns (win.ws_row, win.ws_col);
#if defined (READLINE)
rl_set_screen_size (win.ws_row, win.ws_col);
#endif
if (rp)
*rp = win.ws_row;
if (cp)
*cp = win.ws_col;
#endif
}
#endif
}
+1 -1
View File
@@ -1,6 +1,6 @@
/* locale.c - Miscellaneous internationalization functions. */
/* Copyright (C) 1996-2009,2012,2016,2020 Free Software Foundation, Inc.
/* Copyright (C) 1996-2009,2012,2016-2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+13 -3
View File
@@ -4,7 +4,7 @@
/* ``Have a little faith, there's magic in the night. You ain't a
beauty, but, hey, you're alright.'' */
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
/* Copyright (C) 1987-2021 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -7439,8 +7439,12 @@ verify_substring_values (v, value, substr, vtype, e1p, e2p)
else
t = (char *)0;
temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES);
temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES); /* Q_ARITH? */
#if 1 /* TAG: bash-5.2 */
*e1p = evalexp (temp1, EXP_EXPANDED, &expok);
#else
*e1p = evalexp (temp1, 0, &expok); /* XXX - EXP_EXPANDED? */
#endif
free (temp1);
if (expok == 0)
return (0);
@@ -7495,10 +7499,14 @@ verify_substring_values (v, value, substr, vtype, e1p, e2p)
{
t++;
temp2 = savestring (t);
temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES);
temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); /* Q_ARITH? */
free (temp2);
t[-1] = ':';
#if 1 /* TAG: bash-5.2 */
*e2p = evalexp (temp1, EXP_EXPANDED, &expok);
#else
*e2p = evalexp (temp1, 0, &expok); /* XXX - EXP_EXPANDED? */
#endif
free (temp1);
if (expok == 0)
return (0);
@@ -11682,6 +11690,8 @@ expand_compound_assignment_word (tlist, flags)
free (value);
value = string_list (l);
dispose_words (l);
wlen = STRLEN (value);
/* Now, let's rebuild the string */
+1 -1
View File
@@ -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
+8 -2
View File
@@ -3136,8 +3136,14 @@ bind_variable_internal (name, value, table, hflags, aflags)
VUNSETATTR (tentry, att_nameref);
}
free (tname);
/* XXX - should it be aflags? */
entry = assign_array_element (newval, make_variable_value (entry, value, aflags), aflags|ASS_NAMEREF);
/* entry == nameref variable; tentry == array variable;
newval == x[2]; value = bar
We don't need to call make_variable_value here, since
assign_array_element will eventually do it itself based on
newval and aflags. */
entry = assign_array_element (newval, value, aflags|ASS_NAMEREF);
if (entry == 0)
return entry;
}