commit bash-20170210 snapshot

This commit is contained in:
Chet Ramey
2017-02-22 11:09:11 -05:00
parent 7e92fb358b
commit ac495185aa
17 changed files with 211 additions and 72 deletions
+11
View File
@@ -223,6 +223,8 @@ int dump_po_strings; /* Dump strings in $"..." in po format */
int wordexp_only = 0; /* Do word expansion only */
int protected_mode = 0; /* No command substitution with --wordexp */
int pretty_print_mode = 0; /* pretty-print a shell script */
#if defined (STRICT_POSIX)
int posixly_correct = 1; /* Non-zero means posix.2 superset. */
#else
@@ -251,6 +253,7 @@ static const struct {
{ "noprofile", Int, &no_profile, (char **)0x0 },
{ "norc", Int, &no_rc, (char **)0x0 },
{ "posix", Int, &posixly_correct, (char **)0x0 },
{ "pretty-print", Int, &pretty_print_mode, (char **)0x0 },
#if defined (WORDEXP_OPTION)
{ "protected", Int, &protected_mode, (char **)0x0 },
#endif
@@ -779,6 +782,14 @@ main (argc, argv, env)
shell_initialized = 1;
if (pretty_print_mode && interactive_shell)
{
internal_warning (_("pretty-printing mode ignored in interactive shells"));
pretty_print_mode = 0;
}
if (pretty_print_mode)
exit_shell (pretty_print_loop ());
/* Read commands until exit condition. */
reader_loop ();
exit_shell (last_command_exit_value);