|
Petr Šabata |
33fc6c |
From ad1b3e68229273b4983b607c5eeb56551536c583 Mon Sep 17 00:00:00 2001
|
|
Petr Šabata |
33fc6c |
From: Chet Ramey <chet.ramey@case.edu>
|
|
Petr Šabata |
33fc6c |
Date: Fri, 7 Feb 2020 15:19:53 -0500
|
|
Petr Šabata |
33fc6c |
Subject: [PATCH] Bash-5.0 patch 15: aliases and -c commands can cause
|
|
Petr Šabata |
33fc6c |
premature termination
|
|
Petr Šabata |
33fc6c |
|
|
Petr Šabata |
33fc6c |
---
|
|
Petr Šabata |
33fc6c |
builtins/evalstring.c | 6 ++++--
|
|
Petr Šabata |
33fc6c |
patchlevel.h | 2 +-
|
|
Petr Šabata |
33fc6c |
2 files changed, 5 insertions(+), 3 deletions(-)
|
|
Petr Šabata |
33fc6c |
|
|
Petr Šabata |
33fc6c |
diff --git a/builtins/evalstring.c b/builtins/evalstring.c
|
|
Petr Šabata |
33fc6c |
index cadc9bc0..2f13a66a 100644
|
|
Petr Šabata |
33fc6c |
--- a/builtins/evalstring.c
|
|
Petr Šabata |
33fc6c |
+++ b/builtins/evalstring.c
|
|
Petr Šabata |
33fc6c |
@@ -91,6 +91,7 @@ should_suppress_fork (command)
|
|
Petr Šabata |
33fc6c |
return (startup_state == 2 && parse_and_execute_level == 1 &&
|
|
Petr Šabata |
33fc6c |
running_trap == 0 &&
|
|
Petr Šabata |
33fc6c |
*bash_input.location.string == '\0' &&
|
|
Petr Šabata |
33fc6c |
+ parser_expanding_alias () == 0 &&
|
|
Petr Šabata |
33fc6c |
command->type == cm_simple &&
|
|
Petr Šabata |
33fc6c |
signal_is_trapped (EXIT_TRAP) == 0 &&
|
|
Petr Šabata |
33fc6c |
signal_is_trapped (ERROR_TRAP) == 0 &&
|
|
Petr Šabata |
33fc6c |
@@ -105,6 +106,7 @@ can_optimize_connection (command)
|
|
Petr Šabata |
33fc6c |
COMMAND *command;
|
|
Petr Šabata |
33fc6c |
{
|
|
Petr Šabata |
33fc6c |
return (*bash_input.location.string == '\0' &&
|
|
Petr Šabata |
33fc6c |
+ parser_expanding_alias () == 0 &&
|
|
Petr Šabata |
33fc6c |
(command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
|
|
Petr Šabata |
33fc6c |
command->value.Connection->second->type == cm_simple);
|
|
Petr Šabata |
33fc6c |
}
|
|
Petr Šabata |
33fc6c |
@@ -290,7 +292,7 @@ parse_and_execute (string, from_file, flags)
|
|
Petr Šabata |
33fc6c |
|
|
Petr Šabata |
33fc6c |
with_input_from_string (string, from_file);
|
|
Petr Šabata |
33fc6c |
clear_shell_input_line ();
|
|
Petr Šabata |
33fc6c |
- while (*(bash_input.location.string))
|
|
Petr Šabata |
33fc6c |
+ while (*(bash_input.location.string) || parser_expanding_alias ())
|
|
Petr Šabata |
33fc6c |
{
|
|
Petr Šabata |
33fc6c |
command = (COMMAND *)NULL;
|
|
Petr Šabata |
33fc6c |
|
|
Petr Šabata |
33fc6c |
@@ -545,7 +547,7 @@ parse_string (string, from_file, flags, endp)
|
|
Petr Šabata |
33fc6c |
ostring = string;
|
|
Petr Šabata |
33fc6c |
|
|
Petr Šabata |
33fc6c |
with_input_from_string (string, from_file);
|
|
Petr Šabata |
33fc6c |
- while (*(bash_input.location.string))
|
|
Petr Šabata |
33fc6c |
+ while (*(bash_input.location.string)) /* XXX - parser_expanding_alias () ? */
|
|
Petr Šabata |
33fc6c |
{
|
|
Petr Šabata |
33fc6c |
command = (COMMAND *)NULL;
|
|
Petr Šabata |
33fc6c |
|
|
Petr Šabata |
33fc6c |
diff --git a/patchlevel.h b/patchlevel.h
|
|
Petr Šabata |
33fc6c |
index 09a3cc84..6e9ed3fc 100644
|
|
Petr Šabata |
33fc6c |
--- a/patchlevel.h
|
|
Petr Šabata |
33fc6c |
+++ b/patchlevel.h
|
|
Petr Šabata |
33fc6c |
@@ -25,6 +25,6 @@
|
|
Petr Šabata |
33fc6c |
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
Petr Šabata |
33fc6c |
looks for to find the patch level (for the sccs version string). */
|
|
Petr Šabata |
33fc6c |
|
|
Petr Šabata |
33fc6c |
-#define PATCHLEVEL 14
|
|
Petr Šabata |
33fc6c |
+#define PATCHLEVEL 15
|
|
Petr Šabata |
33fc6c |
|
|
Petr Šabata |
33fc6c |
#endif /* _PATCHLEVEL_H_ */
|
|
Petr Šabata |
33fc6c |
--
|
|
Petr Šabata |
33fc6c |
2.25.1
|
|
Petr Šabata |
33fc6c |
|