mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-27 07:43:07 +02:00
fix error message when completing backquote command substitution; fix test builtin with double negation
This commit is contained in:
+15
-1
@@ -3715,5 +3715,19 @@ execute_cmd.c
|
||||
- execute_select_command: set this_command_name to NULL after running
|
||||
any DEBUG trap like execute_for_command does
|
||||
|
||||
6/23
|
||||
----
|
||||
test.c
|
||||
- three_arguments: when given [ ! ! arg ], make sure to advance POS
|
||||
after calling two_arguments to avoid a `too many arguments' error.
|
||||
Report from Steffen Nurpmeso <steffen@sdaoden.eu>
|
||||
|
||||
|
||||
6/27
|
||||
----
|
||||
subst.c
|
||||
- expand_word_internal: when expanding backquoted command substitution,
|
||||
call string_extract with the SX_REQMATCH flag (closing backquote
|
||||
required) only if the word flags don't contain W_COMPLETE,
|
||||
indicating that we're doing this for completion, probably to
|
||||
determine whether or not to append something to the word. Fixes bug
|
||||
reported by Emanuele Torre <torreemanuele6@gmail.com>.
|
||||
|
||||
+6
-4
@@ -250,7 +250,7 @@ printf_builtin (list)
|
||||
WORD_LIST *list;
|
||||
{
|
||||
int ch, fieldwidth, precision;
|
||||
int have_fieldwidth, have_precision, use_Lmod;
|
||||
int have_fieldwidth, have_precision, use_Lmod, altform;
|
||||
char convch, thisch, nextch, *format, *modstart, *precstart, *fmt, *start;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
char mbch[25]; /* 25 > MB_LEN_MAX, plus can handle 4-byte UTF-8 and large Unicode characters*/
|
||||
@@ -341,7 +341,7 @@ printf_builtin (list)
|
||||
for (fmt = format; *fmt; fmt++)
|
||||
{
|
||||
precision = fieldwidth = 0;
|
||||
have_fieldwidth = have_precision = 0;
|
||||
have_fieldwidth = have_precision = altform = 0;
|
||||
precstart = 0;
|
||||
|
||||
if (*fmt == '\\')
|
||||
@@ -379,9 +379,11 @@ printf_builtin (list)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* found format specification, skip to field width */
|
||||
/* Found format specification, skip to field width. We check for
|
||||
alternate form for possible later use. */
|
||||
for (; *fmt && strchr(SKIP1, *fmt); ++fmt)
|
||||
;
|
||||
if (*fmt == '#')
|
||||
altform++;
|
||||
|
||||
/* Skip optional field width. */
|
||||
if (*fmt == '*')
|
||||
|
||||
@@ -11258,7 +11258,7 @@ add_string:
|
||||
{
|
||||
t_index = sindex++;
|
||||
|
||||
temp = string_extract (string, &sindex, "`", SX_REQMATCH);
|
||||
temp = string_extract (string, &sindex, "`", (word->flags & W_COMPLETE) ? SX_COMPLETE : SX_REQMATCH);
|
||||
/* The test of sindex against t_index is to allow bare instances of
|
||||
` to pass through, for backwards compatibility. */
|
||||
if (temp == &extract_string_error || temp == &extract_string_fatal)
|
||||
|
||||
@@ -804,6 +804,7 @@ three_arguments ()
|
||||
{
|
||||
advance (1);
|
||||
value = !two_arguments ();
|
||||
pos = argc;
|
||||
}
|
||||
else if (argv[pos][0] == '(' && argv[pos+2][0] == ')')
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
BUILD_DIR=/usr/local/build/chet/bash/bash-current
|
||||
BUILD_DIR=/usr/local/build/bash/bash-current
|
||||
THIS_SH=$BUILD_DIR/bash
|
||||
PATH=$PATH:$BUILD_DIR
|
||||
|
||||
|
||||
+3
-1
@@ -220,6 +220,8 @@ t ! -z "$z"
|
||||
0
|
||||
t ! -n "$z"
|
||||
1
|
||||
t ! ! "$z"
|
||||
0
|
||||
t "$zero"
|
||||
1
|
||||
t ! "$zero"
|
||||
@@ -272,7 +274,7 @@ b ( 1 = 2
|
||||
2
|
||||
./test.tests: line 26: test: too many arguments
|
||||
2
|
||||
./test.tests: line 431: [: missing `]'
|
||||
./test.tests: line 434: [: missing `]'
|
||||
2
|
||||
./test.tests: line 26: test: (: unary operator expected
|
||||
2
|
||||
|
||||
@@ -358,6 +358,9 @@ t ! -z "$z"
|
||||
echo 't ! -n "$z"'
|
||||
t ! -n "$z"
|
||||
|
||||
echo 't ! ! "$z"'
|
||||
t ! ! "$z"
|
||||
|
||||
zero=
|
||||
echo 't "$zero"'
|
||||
t "$zero"
|
||||
|
||||
Reference in New Issue
Block a user