Skip to content

Commit ad1b3e6

Browse files
author
Chet Ramey
committed
Bash-5.0 patch 15: aliases and -c commands can cause premature termination
1 parent 8b6524c commit ad1b3e6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

builtins/evalstring.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ should_suppress_fork (command)
9191
return (startup_state == 2 && parse_and_execute_level == 1 &&
9292
running_trap == 0 &&
9393
*bash_input.location.string == '\0' &&
94+
parser_expanding_alias () == 0 &&
9495
command->type == cm_simple &&
9596
signal_is_trapped (EXIT_TRAP) == 0 &&
9697
signal_is_trapped (ERROR_TRAP) == 0 &&
@@ -105,6 +106,7 @@ can_optimize_connection (command)
105106
COMMAND *command;
106107
{
107108
return (*bash_input.location.string == '\0' &&
109+
parser_expanding_alias () == 0 &&
108110
(command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
109111
command->value.Connection->second->type == cm_simple);
110112
}
@@ -290,7 +292,7 @@ parse_and_execute (string, from_file, flags)
290292

291293
with_input_from_string (string, from_file);
292294
clear_shell_input_line ();
293-
while (*(bash_input.location.string))
295+
while (*(bash_input.location.string) || parser_expanding_alias ())
294296
{
295297
command = (COMMAND *)NULL;
296298

@@ -545,7 +547,7 @@ parse_string (string, from_file, flags, endp)
545547
ostring = string;
546548

547549
with_input_from_string (string, from_file);
548-
while (*(bash_input.location.string))
550+
while (*(bash_input.location.string)) /* XXX - parser_expanding_alias () ? */
549551
{
550552
command = (COMMAND *)NULL;
551553

patchlevel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
2626
looks for to find the patch level (for the sccs version string). */
2727

28-
#define PATCHLEVEL 14
28+
#define PATCHLEVEL 15
2929

3030
#endif /* _PATCHLEVEL_H_ */

0 commit comments

Comments
 (0)