diff src/pager.cc @ 2926:66ef74ee5d9f

[project @ 1997-05-05 03:20:52 by jwe]
author jwe
date Mon, 05 May 1997 03:40:21 +0000
parents 8b262e771614
children aa9d0c0e0458
line wrap: on
line diff
--- a/src/pager.cc	Sat May 03 21:24:19 1997 +0000
+++ b/src/pager.cc	Mon May 05 03:40:21 1997 +0000
@@ -29,7 +29,8 @@
 #include <string>
 #include <fstream.h>
 
-#include "oct-term.h"
+#include "cmd-edit.h"
+#include "oct-env.h"
 
 #include "procstream.h"
 
@@ -190,7 +191,7 @@
 {
   if (s)
     {
-      int available_rows = terminal_rows () - 2;
+      int available_rows = command_editor::terminal_rows () - 2;
 
       int count = 0;
 
@@ -271,7 +272,7 @@
 {
   if (! instance)
     instance = new octave_pager_stream ();
-      
+
   return *instance;
 }
 
@@ -432,14 +433,10 @@
 static string
 default_pager (void)
 {
-  string pager_binary;
-
-  char *pgr = getenv ("PAGER");
+  string pager_binary = octave_env::getenv ("PAGER");
 
-  if (pgr)
-    pager_binary = string (pgr);
 #ifdef DEFAULT_PAGER
-  else
+  if (pager_binary.empty ())
     {
       pager_binary = string (DEFAULT_PAGER);
 
@@ -447,7 +444,8 @@
 	{
 	  pager_binary.append (" -e");
 
-	  if (! getenv ("LESS"))
+	  string lessflags = octave_env::getenv ("LESS");
+	  if (lessflags.empty ())
 	    pager_binary.append
 	      (" -P'-- less ?pB(%pB\\%):--. (f)orward, (b)ack, (q)uit$'");
 	}