summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2022-01-04 17:03:45 -0500
committerChet Ramey <chet.ramey@case.edu>2022-01-04 17:03:45 -0500
commit9439ce094c9aa7557a9d53ac7b412a23aa66e36b (patch)
tree57feecf71c2b7986b92c65f5b41f5f49a7eafa57
parent18ad612ea80ba978ae8271800814737e224a4baf (diff)
downloadbash-9439ce094c9aa7557a9d53ac7b412a23aa66e36b.tar.gz
Bash-5.1 patch 16: fix interpretation of multiple instances of ! in [[ conditional commands
-rw-r--r--parse.y2
-rw-r--r--patchlevel.h2
-rw-r--r--y.tab.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index f25575b5..f4168c7c 100644
--- a/parse.y
+++ b/parse.y
@@ -4796,7 +4796,7 @@ cond_term ()
dispose_word (yylval.word); /* not needed */
term = cond_term ();
if (term)
- term->flags |= CMD_INVERT_RETURN;
+ term->flags ^= CMD_INVERT_RETURN;
}
else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word))
{
diff --git a/patchlevel.h b/patchlevel.h
index 252e0819..3c226949 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 15
+#define PATCHLEVEL 16
#endif /* _PATCHLEVEL_H_ */
diff --git a/y.tab.c b/y.tab.c
index c11d7aaa..78b38250 100644
--- a/y.tab.c
+++ b/y.tab.c
@@ -7090,7 +7090,7 @@ cond_term ()
dispose_word (yylval.word); /* not needed */
term = cond_term ();
if (term)
- term->flags |= CMD_INVERT_RETURN;
+ term->flags ^= CMD_INVERT_RETURN;
}
else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word))
{