* Remove the assumption that sst.doc lives in the current directory.
-* Have it read the value of LINES rather than assumong a 24-line terminal.
-
* Do a manual page.
* Improve the internal pager.
\r
static char line[128], *linep = line;\r
static int linecount; /* for paging */\r
+static int screenheight = 24;\r
\r
static void clearscreen(void);\r
\r
while (fgets(linebuf, sizeof(linebuf),fp)) {\r
if (strstr(linebuf, "******"))\r
break;\r
- linebuf[strlen(linebuf)-1] = '\0'; // No \n at end\r
- prout(linebuf);\r
+ /* use fputs here to avoid % expansion */\r
+ fputs(linebuf, stdout);\r
}\r
fclose(fp);\r
}\r
int hitme;\r
char ch;\r
prelim();\r
+ char *LINES = getenv("LINES");\r
+ \r
+ if (LINES)\r
+ screenheight = atoi(LINES);\r
\r
if (argc > 1) {\r
fromcommandline = 1;\r
void skip(int i) {\r
while (i-- > 0) {\r
linecount++;\r
- if (linecount >= 23)\r
+ if (linecount >= screenheight)\r
pause(0);\r
else\r
putchar('\n');\r