mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-07 10:42:28 +02:00
fix for -c command ending with backslash; fix several small memory leaks; fix several uninitialized variables; compgen -V fix
This commit is contained in:
@@ -1696,6 +1696,9 @@ yy_string_get (void)
|
||||
static int
|
||||
yy_string_unget (int c)
|
||||
{
|
||||
if (c == EOF && *bash_input.location.string == '\0')
|
||||
return EOF;
|
||||
|
||||
*(--bash_input.location.string) = c;
|
||||
return (c);
|
||||
}
|
||||
@@ -2162,6 +2165,21 @@ read_a_line (int remove_quoted_newline)
|
||||
line_number++;
|
||||
continue; /* Make the unquoted \<newline> pair disappear. */
|
||||
}
|
||||
else if (peekc == EOF)
|
||||
{
|
||||
/* Don't push EOF back. */
|
||||
#if 1
|
||||
/* Leave this in for now, relies on how the expansion code
|
||||
treats an unescaped backslash at the end of a word. */
|
||||
RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128);
|
||||
if (expanding_alias() == 0 &&
|
||||
(bash_input.type == st_string || bash_input.type == st_bstream ||
|
||||
(interactive == 0 && bash_input.type == st_stream)))
|
||||
line_buffer[indx++] = '\\'; /* like below in shell_getc */
|
||||
#endif
|
||||
line_buffer[indx++] = c;
|
||||
c = '\n'; /* force break below */
|
||||
}
|
||||
else
|
||||
{
|
||||
yy_ungetc (peekc);
|
||||
|
||||
Reference in New Issue
Block a user