7 Bug-Reported-by: Yu Kou <ckyoog@gmail.com>
8 Bug-Reference-ID: <CAAqoF9Ko3nAShJXGzucafs-ByUagzZ4nbQonwEkwC7s9UqfWKw@mail.gmail.com>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2019-05/msg00032.html
13 If alias expansion is enabled when processing the command argument to the
14 `-c' option, an alias is defined in that command, and the command ends with
15 the invocation of that alias, the shell's command parser can prematurely
16 terminate before the entire command is executed.
18 Patch (apply with `patch -p0'):
20 *** ../bash-20190426/builtins/evalstring.c 2019-01-29 14:15:19.000000000 -0500
21 --- builtins/evalstring.c 2019-05-15 14:19:36.000000000 -0400
26 *bash_input.location.string == '\0' &&
27 + parser_expanding_alias () == 0 &&
28 command->type == cm_simple &&
29 signal_is_trapped (EXIT_TRAP) == 0 &&
34 return (*bash_input.location.string == '\0' &&
35 + parser_expanding_alias () == 0 &&
36 (command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
37 command->value.Connection->second->type == cm_simple);
40 with_input_from_string (string, from_file);
41 clear_shell_input_line ();
42 ! while (*(bash_input.location.string))
44 command = (COMMAND *)NULL;
46 with_input_from_string (string, from_file);
47 clear_shell_input_line ();
48 ! while (*(bash_input.location.string) || parser_expanding_alias ())
50 command = (COMMAND *)NULL;
54 with_input_from_string (string, from_file);
55 ! while (*(bash_input.location.string))
57 command = (COMMAND *)NULL;
60 with_input_from_string (string, from_file);
61 ! while (*(bash_input.location.string)) /* XXX - parser_expanding_alias () ? */
63 command = (COMMAND *)NULL;
64 *** ../bash-5.0/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
65 --- patchlevel.h 2016-10-01 11:01:28.000000000 -0400
68 looks for to find the patch level (for the sccs version string). */
70 ! #define PATCHLEVEL 14
72 #endif /* _PATCHLEVEL_H_ */
74 looks for to find the patch level (for the sccs version string). */
76 ! #define PATCHLEVEL 15
78 #endif /* _PATCHLEVEL_H_ */