summaryrefslogtreecommitdiff
path: root/vtysh
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-20 19:07:48 +0000
committerhasso <hasso>2004-10-20 19:07:48 +0000
commit97b7db2d02863c718c53faf02d13a92260035ea8 (patch)
tree0022eb8ebf2612d6fe8f51b3261089182ecb420a /vtysh
parent6590f2c3dc10acaa04cea3206fd00445e0a6145c (diff)
Don't popen pager if command is "exit". Fixes "vtysh screws up my terminal
if I exit" issue.
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/ChangeLog5
-rw-r--r--vtysh/vtysh.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/vtysh/ChangeLog b/vtysh/ChangeLog
index 33f6d124..b6a2eeaa 100644
--- a/vtysh/ChangeLog
+++ b/vtysh/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-20 Hasso Tepper <hasso at quagga.net>
+
+ * vtysh.c: Don't popen pager if command is "exit". Fixes "vtysh screws
+ up my terminal if I exit" issue.
+
2004-10-13 Hasso Tepper <hasso at quagga.net>
* extract.pl.in: All daemons can use both IPv6 and IPv4 access lists
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 086b5dfe..cea91b3e 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -283,7 +283,10 @@ vtysh_execute_func (const char *line, int pager)
break;
case CMD_SUCCESS_DAEMON:
{
- if (pager && vtysh_pager_name)
+ /* FIXME: Don't open pager for exit commands. popen() causes problems
+ * if exited from vtysh at all. This hack shouldn't cause any problem
+ * but is really ugly. */
+ if (pager && vtysh_pager_name && (strncmp(line, "exit", 4) != 0))
{
fp = popen (vtysh_pager_name, "w");
if (fp == NULL)