summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-07-26 20:00:36 -0700
committerJohn Southworth <john.southworth@vyatta.com>2011-07-26 20:00:36 -0700
commit1cdbebe98a07d899b38b1769945bdd183ca254d2 (patch)
tree31946c6ef9c9e31973e85f68466fa18dbda7d67d
parentff7496b39917c074a7069599f4d48dc476e31619 (diff)
downloadvyatta-bash-1cdbebe98a07d899b38b1769945bdd183ca254d2.tar.gz
vyatta-bash-1cdbebe98a07d899b38b1769945bdd183ca254d2.zip
Bugfix 6828: Make bash print a friendly message when exiting configuration mode with ctrl+d
-rw-r--r--parse.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 31f6ea9..19218fd 100644
--- a/parse.y
+++ b/parse.y
@@ -5614,8 +5614,14 @@ handle_eof_input_unit ()
{
if (eof_encountered < eof_encountered_limit)
{
- fprintf (stderr, _("Use \"%s\" to leave the shell.\n"),
+ char *vyatta_configure_mode = getenv ( "_OFR_CONFIGURE" );
+ if (*vyatta_configure_mode != NULL) {
+ fprintf (stderr, _("Use \"%s\" to leave configuration mode.\n"),
login_shell ? "logout" : "exit");
+ } else {
+ fprintf (stderr, _("Use \"%s\" to leave the shell.\n"),
+ login_shell ? "logout" : "exit");
+ }
eof_encountered++;
/* Reset the parsing state. */
last_read_token = current_token = '\n';