]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Don't popen pager if command is "exit". Fixes "vtysh screws up my terminal
authorhasso <hasso>
Wed, 20 Oct 2004 19:07:48 +0000 (19:07 +0000)
committerhasso <hasso>
Wed, 20 Oct 2004 19:07:48 +0000 (19:07 +0000)
if I exit" issue.

vtysh/ChangeLog
vtysh/vtysh.c

index 33f6d1246a5737f30a4109c8b02d3ba387c2fdc7..b6a2eeaa62ad4d2e1f24c4d9412b753a0ea5386d 100644 (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>
 
        * extract.pl.in: All daemons can use both IPv6 and IPv4 access lists
index 086b5dfe5fc233bc0b3f67b87bcb61729895dfee..cea91b3e86d6add14b78fb03d960191bcacace73 100644 (file)
@@ -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)