commit bash-20160226 snapshot

This commit is contained in:
Chet Ramey
2016-03-01 16:44:33 -05:00
parent 9c94505d46
commit ccb4014f23
18 changed files with 2554 additions and 47 deletions
+17 -5
View File
@@ -2314,7 +2314,7 @@ shell_getc (remove_quoted_newline)
if (n <= 2) /* we have to save 1 for the newline added below */
{
if (truncating == 0)
internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, (unsigned long)SIZE_MAX);
internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%lu): line truncated", shell_input_line_size, (unsigned long)SIZE_MAX);
shell_input_line[i] = '\0';
truncating = 1;
}
@@ -5333,7 +5333,7 @@ decode_prompt_string (string)
#if defined (PROMPT_STRING_DECODE)
int result_size, result_index;
int c, n, i;
char *temp, octal_string[4];
char *temp, *t_host, octal_string[4];
struct tm *tm;
time_t the_time;
char timebuf[128];
@@ -5481,7 +5481,11 @@ decode_prompt_string (string)
case 's':
temp = base_pathname (shell_name);
temp = savestring (temp);
/* Try to quote anything the user can set in the file system */
if (promptvars || posixly_correct)
temp = sh_backslash_quote_for_double_quotes (temp);
else
temp = savestring (temp);
goto add_string;
case 'v':
@@ -5571,9 +5575,17 @@ decode_prompt_string (string)
case 'h':
case 'H':
temp = savestring (current_host_name);
if (c == 'h' && (t = (char *)strchr (temp, '.')))
t_host = savestring (current_host_name);
if (c == 'h' && (t = (char *)strchr (t_host, '.')))
*t = '\0';
if (promptvars || posixly_correct)
/* Make sure that expand_prompt_string is called with a
second argument of Q_DOUBLE_QUOTES if we use this
function here. */
temp = sh_backslash_quote_for_double_quotes (t_host);
else
temp = savestring (t_host);
free (t_host);
goto add_string;
case '#':