Commit 5f555c4c 5f555c4cb4ea9ba258605c5882b7712f3278a090 by Sergey Poznyakoff

* comsat/comsat.c (comsat_cfg_param): Reword a help message

for require-tty.
* examples/header.c (cmd_readline): New function.
New command 'readline'.
* po/POTFILES.in: Remove stray reference to muerrno.c
1 parent 31fbfbfb
2008-02-09 Sergey Poznyakoff <gray@gnu.org.ua>
* comsat/comsat.c (comsat_cfg_param): Reword a help message
for require-tty.
* examples/header.c (cmd_readline): New function.
New command 'readline'.
* po/POTFILES.in: Remove stray reference to muerrno.c
2008-02-08 Sergey Poznyakoff <gray@gnu.org.ua>
* comsat/action.c (act_getline): Bugfix. Do not return eof
......
......@@ -122,7 +122,7 @@ struct mu_cfg_param comsat_cfg_param[] = {
{ "allow-biffrc", mu_cfg_bool, &allow_biffrc, 0, NULL,
N_("Read .biffrc file from the user home directory") },
{ "require-tty", mu_cfg_bool, &require_tty, 0, NULL,
N_("Notify only if the user be logged on one of the ttys.") },
N_("Notify only if the user is logged on one of the ttys.") },
{ "max-lines", mu_cfg_int, &maxlines, 0, NULL,
N_("Maximum number of message body lines to be output.") },
{ "max-requests", mu_cfg_uint, &maxrequests, 0, NULL,
......
......@@ -334,6 +334,25 @@ cmd_iterate (int argc, char **argv)
}
}
void
cmd_readline (int argc, char **argv)
{
char *buf;
size_t size;
mu_stream_t stream;
size_t nbytes;
if (check_args (argv[0], argc, 1, 2))
return;
size = atoi (argv[1]);
buf = malloc (size);
if (!buf)
abort ();
mu_header_get_stream (header, &stream);
mu_stream_readline (stream, buf, size, 0, &nbytes);
printf ("\"%*.*s\"", nbytes, nbytes, buf);
free (buf);
}
struct cmdtab
......@@ -354,6 +373,7 @@ static struct cmdtab cmdtab[] = {
"find and print the Nth (by default, 1st) instance of header named NAME" },
{ "dump", cmd_dump, NULL, "dump all headers on screen" },
{ "itr", cmd_iterate, "[first|1|next|n]", "iterate over headers" },
{ "readline", cmd_readline, "[SIZE]", "read line" },
{ "remove", cmd_remove, "NAME [N]",
"remove the Nth (by default, 1st) instance of header named NAME" },
{ "insert", cmd_insert, "NAME VALUE [REF [NUM] [before|after] [replace]]",
......
......@@ -150,7 +150,6 @@ mailbox/ipsrv.c
mailbox/message.c
mailbox/msrv.c
mailbox/mu_auth.c
mailbox/muerrno.c
mailbox/mutil.c
mailbox/parsedate.y
mailbox/registrar.c
......