Browse Source

Brown paperbag, please. Don't segfault if VTYSH_PAGER isn't defined.

hasso 17 years ago
parent
commit
5a9c53ded3
1 changed files with 7 additions and 2 deletions
  1. 7 2
      vtysh/vtysh.c

+ 7 - 2
vtysh/vtysh.c

@@ -212,8 +212,13 @@ vtysh_exit_ripd_only ()
 void
 vtysh_pager_init ()
 {
-  vtysh_pager_name = strdup (getenv ("VTYSH_PAGER"));
-  if (! vtysh_pager_name)
+  char *pager_defined;
+
+  pager_defined = getenv ("VTYSH_PAGER");
+
+  if (pager_defined)
+    vtysh_pager_name = strdup (pager_defined);
+  else
     vtysh_pager_name = strdup ("more");
 }