commit | 5a9c53ded34d688dd4362d0664ee3cdcb737e7db | [log] [tgz] |
---|---|---|
author | hasso <hasso> | Fri Aug 27 14:23:28 2004 +0000 |
committer | hasso <hasso> | Fri Aug 27 14:23:28 2004 +0000 |
tree | 6ee96a36abd45ebb05efbbd8275f572a8eeda180 | |
parent | 34553cc3c996bb530652663810664935f40f5560 [diff] [blame] |
Brown paperbag, please. Don't segfault if VTYSH_PAGER isn't defined.
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 28ad39b..45596b2 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c
@@ -212,8 +212,13 @@ 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"); }