Don't popen pager if command is "exit". Fixes "vtysh screws up my terminal

if I exit" issue.
This commit is contained in:
hasso 2004-10-20 19:07:48 +00:00
parent 6590f2c3dc
commit 97b7db2d02
2 changed files with 9 additions and 1 deletions

View File

@ -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> 2004-10-13 Hasso Tepper <hasso at quagga.net>
* extract.pl.in: All daemons can use both IPv6 and IPv4 access lists * extract.pl.in: All daemons can use both IPv6 and IPv4 access lists

View File

@ -283,7 +283,10 @@ vtysh_execute_func (const char *line, int pager)
break; break;
case CMD_SUCCESS_DAEMON: 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"); fp = popen (vtysh_pager_name, "w");
if (fp == NULL) if (fp == NULL)