Commit 8cc9f7db 8cc9f7dba5d4f6bc4c68f057c59d7268f93c1ca8 by Alain Magloire

* mail/header.c: We were looping forever in here. The loop

 is not need it, header only prints one page that includes
 the message specified i.e. the header command only takes
 a message number as an argument that will serve as a reference
 to display a screen full.

 * mail/help.c: Use the pager code, the help is long.
1 parent fd292738
......@@ -24,6 +24,16 @@
2001-06-25 Alain Magloire
* mail/header.c: We were looping forever in here. The loop
is not need it, header only prints one page that includes
the message specified i.e. the header command only takes
a message number as an argument that will serve as a reference
to display a screen full.
* mail/help.c: Use the pager code, the help is long.
2001-06-25 Alain Magloire
* doc/Makefile.am: add {c-api,framework,programs}.texi EXTRA_DIST
* imap4d/imap4d.c (imap4d_usage): Cut and paste typo.
* pop3d/pop3d.c (pop3d_usage): Cut and paste typo.
......
......@@ -29,17 +29,15 @@
int
mail_headers (int argc, char **argv)
{
int low = 1, high = total, *list = NULL, i = 0;
int low = 1, high = total, *list = NULL;
int lines = util_screen_lines ();
int num = util_expand_msglist (argc, argv, &list);
lines = (lines / num) - 2;
for (i = 0; i < num; i++)
{
if (lines < total)
{
low = list[i] - (lines / 2);
low = list[0] - (lines / 2);
if (low < 1)
low = 1;
high = low + lines;
......@@ -51,7 +49,6 @@ mail_headers (int argc, char **argv)
}
util_do_command ("from %d-%d", low, high);
}
free (list);
return 0;
......
......@@ -28,13 +28,23 @@ mail_help (int argc, char **argv)
if (argc < 2)
{
int i = 0;
FILE *out = ofile;
if ((util_find_env("crt"))->set)
out = popen (getenv("PAGER"), "w");
while (mail_command_table[i].synopsis != 0)
fprintf (ofile, "%s\n", mail_command_table[i++].synopsis);
fprintf (out, "%s\n", mail_command_table[i++].synopsis);
if (out != ofile)
pclose (out);
return 0;
}
else
{
int status = 0, cmd = 0;
while (++cmd < argc)
{
struct mail_command_entry entry = util_find_entry (argv[cmd]);
......