summaryrefslogtreecommitdiff
path: root/mh
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-08-25 10:31:59 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-08-25 10:31:59 +0300
commit8619a1cb3b5a4b84b365571b711cf792e12ab620 (patch)
tree2932c275c7d31826f79d5fef7ab962a4101819ff /mh
parent0c606c74e0195d00bb1410114e7b871c08c2a7f0 (diff)
downloadmailutils-8619a1cb3b5a4b84b365571b711cf792e12ab620.tar.gz
mailutils-8619a1cb3b5a4b84b365571b711cf792e12ab620.tar.bz2
Change error messages to comply with the GNU standards.
The string MESSAGE should not begin with a capital letter when it follows a program name and/or file name, because that isn't the beginning of a sentence. (The sentence conceptually starts at the beginning of the line.) Also, it should not end with a period. * include/mailutils/diag.h (mu_diag_funcall): New prototype. * mailbox/diag.c: New function. * comsat/action.c, comsat/comsat.c, comsat/oldcfg.c, config/mailutils-config.c, configure.ac, dotlock/dotlock.c, frm/common.c, frm/from.c, guimb/collect.c, guimb/main.c, guimb/util.c, imap4d/auth_gsasl.c, imap4d/auth_gss.c, imap4d/bye.c, imap4d/close.c, imap4d/imap4d.c, imap4d/login.c, imap4d/preauth.c, imap4d/signal.c, imap4d/starttls.c, imap4d/util.c, lib/mailcap.c, lib/tcpwrap.c, libmu_argp/mu_argp.c, libmu_auth/ldap.c, libmu_auth/radius.c, libmu_auth/sql.c, libmu_auth/tls.c, libmu_cfg/acl.c, libmu_cfg/common.c, libmu_cfg/init.c, libmu_cfg/ldap.c, libmu_cfg/sql.c, libmu_sieve/actions.c, libmu_sieve/comparator.c, libmu_sieve/extensions/moderator.c, libmu_sieve/prog.c, libmu_sieve/sieve.l, libproto/imap/folder.c, libproto/mbox/mbox.c, maidag/deliver.c, maidag/lmtp.c, maidag/maidag.c, maidag/mailquota.c, maidag/mailtmp.c, maidag/script.c, mail/alias.c, mail/cd.c, mailbox/cfg_lexer.l, mailbox/cfg_parser.y, mailbox/file_stream.c, mailbox/gocs.c, mailbox/msrv.c, mailbox/mutil.c, mailbox/registrar.c, messages/messages.c, mh/folder.c, mh/forw.c, mh/inc.c, mh/mark.c, mh/mh_ctx.c, mh/mh_fmtgram.y, mh/mh_format.c, mh/mh_init.c, mh/mh_list.c, mh/mh_msgset.c, mh/mh_whatnow.c, mh/mh_whom.c, mh/mhl.c, mh/mhn.c, mh/pick.c, mh/refile.c, mh/repl.c, mh/rmf.c, mh/scan.c, mh/send.c, mimeview/mimetypes.l, mimeview/mimeview.c, movemail/movemail.c, pop3d/apop.c, pop3d/bulletin.c, pop3d/extra.c, pop3d/lock.c, pop3d/logindelay.c, pop3d/pop3d.c, pop3d/popauth.c, pop3d/quit.c, pop3d/signal.c, pop3d/user.c, readmsg/readmsg.c, sieve/sieve.c: Fix error messages.
Diffstat (limited to 'mh')
-rw-r--r--mh/folder.c21
-rw-r--r--mh/forw.c8
-rw-r--r--mh/inc.c14
-rw-r--r--mh/mark.c5
-rw-r--r--mh/mh_ctx.c4
-rw-r--r--mh/mh_fmtgram.y4
-rw-r--r--mh/mh_format.c4
-rw-r--r--mh/mh_init.c52
-rw-r--r--mh/mh_list.c24
-rw-r--r--mh/mh_msgset.c8
-rw-r--r--mh/mh_whatnow.c6
-rw-r--r--mh/mh_whom.c6
-rw-r--r--mh/mhl.c16
-rw-r--r--mh/mhn.c32
-rw-r--r--mh/pick.c9
-rw-r--r--mh/refile.c16
-rw-r--r--mh/repl.c10
-rw-r--r--mh/rmf.c9
-rw-r--r--mh/scan.c4
-rw-r--r--mh/send.c36
20 files changed, 148 insertions, 140 deletions
diff --git a/mh/folder.c b/mh/folder.c
index 9a20f69e4..0e6ad015e 100644
--- a/mh/folder.c
+++ b/mh/folder.c
@@ -1,6 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -151,7 +151,7 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
char *p;
pack_start = strtoul (arg, &p, 10);
if (*p)
- argp_error (state, _("Invalid number"));
+ argp_error (state, _("invalid number"));
}
break;
@@ -327,7 +327,7 @@ _scan (const char *name, size_t depth)
if (!dir)
{
- mu_error (_("Cannot scan folder %s: %s"), name, strerror (errno));
+ mu_error (_("cannot scan folder %s: %s"), name, strerror (errno));
return;
}
@@ -362,7 +362,7 @@ _scan (const char *name, size_t depth)
{
asprintf (&p, "%s/%s", name, entry->d_name);
if (stat (p, &st) < 0)
- mu_error (_("Cannot stat %s: %s"), p, strerror (errno));
+ mu_diag_funcall (MU_DIAG_ERROR, "stat", p, errno);
else if (S_ISDIR (st.st_mode))
{
info.others++;
@@ -531,15 +531,16 @@ action_list ()
static void
get_stack (int *pc, char ***pv)
{
+ int status;
const char *stack = mh_global_context_get ("Folder-Stack", NULL);
if (!stack)
{
*pc = 0;
*pv = NULL;
}
- else if (mu_argcv_get (stack, NULL, "#", pc, pv))
+ else if ((status = mu_argcv_get (stack, NULL, "#", pc, pv)) != 0)
{
- mu_error (_("Cannot split line %s"), stack);
+ mu_diag_funcall (MU_DIAG_ERROR, "mu_argcv_get", stack, status);
exit (1);
}
}
@@ -722,7 +723,7 @@ roll_back (const char *folder_name, struct pack_tab *pack_tab, size_t i)
return;
start = i - 1;
- mu_error (_("Rolling back changes..."));
+ mu_error (_("rolling back changes..."));
while (--i >= 0)
if (pack_rename (pack_tab + i, 1))
{
@@ -737,7 +738,7 @@ roll_back (const char *folder_name, struct pack_tab *pack_tab, size_t i)
mu_error (_("You will have to fix it manually."));
exit (1);
}
- mu_error (_("Folder `%s' restored successfully"), folder_name);
+ mu_error (_("folder `%s' restored successfully"), folder_name);
}
struct fixup_data
@@ -846,7 +847,7 @@ action_pack ()
/* Allocate pack table */
if (mu_mailbox_messages_count (mbox, &count))
{
- mu_error (_("Cannot read input mailbox: %s"), mu_strerror (errno));
+ mu_error (_("cannot read input mailbox: %s"), mu_strerror (errno));
return 1;
}
pack_tab = xcalloc (count, sizeof pack_tab[0]); /* Never freed. No use to
@@ -968,7 +969,7 @@ main (int argc, char **argv)
}
else if (argc - index > 1)
{
- mu_error (_("Too many arguments"));
+ mu_error (_("too many arguments"));
exit (1);
}
diff --git a/mh/forw.c b/mh/forw.c
index 977c347b9..a3da894c7 100644
--- a/mh/forw.c
+++ b/mh/forw.c
@@ -1,6 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005, 2006, 2007,
- 2008 Free Software Foundation, Inc.
+ 2008, 2009 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -158,7 +158,7 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
width = strtoul (arg, NULL, 0);
if (!width)
{
- argp_error (state, _("Invalid width"));
+ argp_error (state, _("invalid width"));
exit (1);
}
break;
@@ -206,7 +206,7 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
case ARG_INPLACE:
case ARG_WHATNOWPROC:
case ARG_NOWHATNOWPROC:
- argp_error (state, _("Option is not yet implemented"));
+ argp_error (state, _("option is not yet implemented"));
exit (1);
case ARG_LICENSE:
@@ -340,7 +340,7 @@ finish_draft ()
MU_STREAM_WRITE|MU_STREAM_CREAT)) != 0
|| (rc = mu_stream_open (stream)))
{
- mu_error (_("Cannot open output file `%s': %s"),
+ mu_error (_("cannot open output file `%s': %s"),
wh_env.file, mu_strerror (rc));
exit (1);
}
diff --git a/mh/inc.c b/mh/inc.c
index 3ebd4aee7..c022ae18b 100644
--- a/mh/inc.c
+++ b/mh/inc.c
@@ -1,6 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -133,7 +133,7 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
width = strtoul (arg, NULL, 0);
if (!width)
{
- argp_error (state, _("Invalid width"));
+ argp_error (state, _("invalid width"));
exit (1);
}
break;
@@ -196,7 +196,7 @@ main (int argc, char **argv)
{
if ((rc = mu_mailbox_create_default (&input, NULL)) != 0)
{
- mu_error (_("Cannot create default mailbox: %s"),
+ mu_error (_("cannot create default mailbox: %s"),
mu_strerror (rc));
exit (1);
}
@@ -205,7 +205,7 @@ main (int argc, char **argv)
}
else if ((rc = mu_mailbox_create_default (&input, input_file)) != 0)
{
- mu_error (_("Cannot create mailbox %s: %s"),
+ mu_error (_("cannot create mailbox %s: %s"),
input_file, mu_strerror (rc));
exit (1);
}
@@ -214,7 +214,7 @@ main (int argc, char **argv)
{
mu_url_t url;
mu_mailbox_get_url (input, &url);
- mu_error (_("Cannot open mailbox %s: %s"),
+ mu_error (_("cannot open mailbox %s: %s"),
mu_url_to_string (url),
mu_strerror (errno));
exit (1);
@@ -222,14 +222,14 @@ main (int argc, char **argv)
if ((rc = mu_mailbox_messages_count (input, &total)) != 0)
{
- mu_error (_("Cannot read input mailbox: %s"), mu_strerror (errno));
+ mu_error (_("cannot read input mailbox: %s"), mu_strerror (errno));
exit (1);
}
output = mh_open_folder (append_folder, 1);
if ((rc = mu_mailbox_messages_count (output, &lastmsg)) != 0)
{
- mu_error (_("Cannot read output mailbox: %s"),
+ mu_error (_("cannot read output mailbox: %s"),
mu_strerror (errno));
exit (1);
}
diff --git a/mh/mark.c b/mh/mark.c
index 78f826059..53b8cc55a 100644
--- a/mh/mark.c
+++ b/mh/mark.c
@@ -1,5 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2006, 2007, 2008,
+ 2009 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -68,7 +69,7 @@ add_sequence (char *name)
{
if (!seq_list && mu_list_create (&seq_list))
{
- mu_error (_("Cannot create sequence list"));
+ mu_error (_("cannot create sequence list"));
exit (1);
}
mu_list_append (seq_list, name);
diff --git a/mh/mh_ctx.c b/mh/mh_ctx.c
index 6d3bb562e..c7b1a0ed6 100644
--- a/mh/mh_ctx.c
+++ b/mh/mh_ctx.c
@@ -141,7 +141,7 @@ mh_context_write (mh_context_t *ctx)
fp = fopen (ctx->name, "w");
if (!fp)
{
- mu_error (_("Cannot open context file %s: %s"),
+ mu_error (_("cannot open context file %s: %s"),
ctx->name, strerror (errno));
return MU_ERR_FAILURE;
}
@@ -180,7 +180,7 @@ mh_context_set_value (mh_context_t *ctx, const char *name, const char *value)
int rc;
if ((rc = mu_header_create (&ctx->header, NULL, 0, NULL)) != 0)
{
- mu_error (_("Cannot create context %s: %s"),
+ mu_error (_("cannot create context %s: %s"),
ctx->name,
mu_strerror (rc));
return 1;
diff --git a/mh/mh_fmtgram.y b/mh/mh_fmtgram.y
index 845fd12cb..d1b08418f 100644
--- a/mh/mh_fmtgram.y
+++ b/mh/mh_fmtgram.y
@@ -638,7 +638,7 @@ mh_code_builtin (mh_builtin_t *bp, int argtype)
}
else
{
- mu_error (_("Missing argument for %s"), bp->name);
+ mu_error (_("missing argument for %s"), bp->name);
return 0;
}
}
@@ -647,7 +647,7 @@ mh_code_builtin (mh_builtin_t *bp, int argtype)
switch (bp->argtype)
{
case mhtype_none:
- mu_error (_("Extra arguments to %s"), bp->name);
+ mu_error (_("extra arguments to %s"), bp->name);
return 0;
case mhtype_num:
diff --git a/mh/mh_format.c b/mh/mh_format.c
index 520a073c6..04552adf5 100644
--- a/mh/mh_format.c
+++ b/mh/mh_format.c
@@ -1,6 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1814,7 +1814,7 @@ builtin_rcpt (struct mh_machine *mach)
int rc = mh_decode_rcpt_flag (strobj_ptr (&mach->arg_str));
if (rc == RCPT_NONE)
{
- mu_error (_("Invalid recipient mask"));
+ mu_error (_("invalid recipient mask"));
/* try to continue anyway */
}
mach->arg_num = rc & rcpt_mask;
diff --git a/mh/mh_init.c b/mh/mh_init.c
index fff162da4..820d6f62d 100644
--- a/mh/mh_init.c
+++ b/mh/mh_init.c
@@ -69,14 +69,14 @@ mh_read_formfile (char *name, char **pformat)
if (stat (name, &st))
{
- mu_error (_("Cannot stat format file %s: %s"), name, strerror (errno));
+ mu_error (_("cannot stat format file %s: %s"), name, strerror (errno));
return -1;
}
fp = fopen (name, "r");
if (!fp)
{
- mu_error (_("Cannot open format file %s: %s"), name, strerror (errno));
+ mu_error (_("cannot open format file %s: %s"), name, strerror (errno));
return -1;
}
@@ -111,7 +111,7 @@ mh_read_formfile (char *name, char **pformat)
void
mh_err_memory (int fatal)
{
- mu_error (_("Not enough memory"));
+ mu_error (_("not enough memory"));
if (fatal)
abort ();
}
@@ -127,7 +127,7 @@ mh_get_my_name (char *name)
struct passwd *pw = getpwuid (getuid ());
if (!pw)
{
- mu_error (_("Cannot determine my username"));
+ mu_error (_("cannot determine my username"));
return;
}
name = pw->pw_name;
@@ -230,13 +230,13 @@ make_dir_hier (const char *p, mode_t perm)
{
if (errno != ENOENT)
{
- mu_error (_("Cannot create directory %s: error accessing name component %s: %s"),
+ mu_error (_("cannot create directory %s: error accessing name component %s: %s"),
p, dir, strerror (errno));
rc = 1;
}
else if ((rc = mkdir (dir, perm)))
- mu_error (_("Cannot create directory %s: error creating name component %s: %s"),
+ mu_error (_("cannot create directory %s: error creating name component %s: %s"),
p, dir, mu_strerror (rc));
}
*q = '/';
@@ -261,7 +261,7 @@ mh_makedir (const char *p)
{
rc = mkdir (p, perm);
if (rc)
- mu_error (_("Cannot create directory %s: %s"),
+ mu_error (_("cannot create directory %s: %s"),
p, strerror (errno));
}
@@ -284,14 +284,14 @@ mh_check_folder (const char *pathname, int confirm)
{
if (errno == ENOENT)
{
- if (!confirm || mh_getyn (_("Create folder \"%s\""), p))
+ if (!confirm || mh_getyn (_("create folder \"%s\""), p))
return mh_makedir (p);
else
return 1;
}
else
{
- mu_error (_("Cannot stat %s: %s"), p, strerror (errno));
+ mu_diag_funcall (MU_DIAG_ERROR, "stat", p, errno);
return 1;
}
}
@@ -382,7 +382,7 @@ mh_audit_open (char *name, mu_mailbox_t mbox)
asprintf (&p, "%s/%s", mu_folder_directory (), namep);
if (!p)
{
- mu_error (_("Not enough memory"));
+ mu_error (_("not enough memory"));
exit (1);
}
free (namep);
@@ -392,7 +392,7 @@ mh_audit_open (char *name, mu_mailbox_t mbox)
fp = fopen (namep, "a");
if (!fp)
{
- mu_error (_("Cannot open audit file %s: %s"), namep, strerror (errno));
+ mu_error (_("cannot open audit file %s: %s"), namep, strerror (errno));
free (namep);
return NULL;
}
@@ -435,7 +435,7 @@ mh_open_folder (const char *folder, int create)
if (mu_mailbox_create_default (&mbox, name))
{
- mu_error (_("Cannot create mailbox %s: %s"),
+ mu_error (_("cannot create mailbox %s: %s"),
name, strerror (errno));
exit (1);
}
@@ -445,7 +445,7 @@ mh_open_folder (const char *folder, int create)
if (mu_mailbox_open (mbox, flags))
{
- mu_error (_("Cannot open mailbox %s: %s"), name, strerror (errno));
+ mu_error (_("cannot open mailbox %s: %s"), name, strerror (errno));
exit (1);
}
@@ -523,7 +523,7 @@ mh_iterate (mu_mailbox_t mbox, mh_msgset_t *msgset,
num = msgset->list[i];
if ((rc = mu_mailbox_get_message (mbox, num, &msg)) != 0)
{
- mu_error (_("Cannot get message %d: %s"), num, mu_strerror (rc));
+ mu_error (_("cannot get message %d: %s"), num, mu_strerror (rc));
return 1;
}
@@ -539,9 +539,9 @@ mh_spawnp (const char *prog, const char *file)
int argc, i, rc, status;
char **argv, **xargv;
- if (mu_argcv_get (prog, "", "#", &argc, &argv))
+ if ((rc = mu_argcv_get (prog, "", "#", &argc, &argv)) != 0)
{
- mu_error (_("Cannot split line %s"), prog);
+ mu_diag_funcall (MU_DIAG_ERROR, "mu_argcv_get", prog, rc);
mu_argcv_free (argc, argv);
return 1;
}
@@ -593,7 +593,7 @@ mh_file_copy (const char *from, const char *to)
if ((rc = mu_file_stream_create (&in, from, MU_STREAM_READ)) != 0
|| (rc = mu_stream_open (in)))
{
- mu_error (_("Cannot open input file `%s': %s"),
+ mu_error (_("cannot open input file `%s': %s"),
from, mu_strerror (rc));
free (buffer);
return 1;
@@ -602,7 +602,7 @@ mh_file_copy (const char *from, const char *to)
if ((rc = mu_file_stream_create (&out, to, MU_STREAM_RDWR|MU_STREAM_CREAT)) != 0
|| (rc = mu_stream_open (out)))
{
- mu_error (_("Cannot open output file `%s': %s"),
+ mu_error (_("cannot open output file `%s': %s"),
to, mu_strerror (rc));
free (buffer);
mu_stream_close (in);
@@ -616,7 +616,7 @@ mh_file_copy (const char *from, const char *to)
{
if ((rc = mu_stream_sequential_write (out, buffer, rdsize)) != 0)
{
- mu_error (_("Write error on `%s': %s"),
+ mu_error (_("write error on `%s': %s"),
to, mu_strerror (rc));
break;
}
@@ -642,20 +642,20 @@ _file_to_message (const char *file_name)
if (stat (file_name, &st) < 0)
{
- mu_error (_("Cannot stat file %s: %s"), file_name, strerror (errno));
+ mu_error (_("cannot stat file %s: %s"), file_name, strerror (errno));
return NULL;
}
if ((rc = mu_file_stream_create (&instream, file_name, MU_STREAM_READ)))
{
- mu_error (_("Cannot create input stream (file %s): %s"),
+ mu_error (_("cannot create input stream (file %s): %s"),
file_name, mu_strerror (rc));
return NULL;
}
if ((rc = mu_stream_open (instream)))
{
- mu_error (_("Cannot open input stream (file %s): %s"),
+ mu_error (_("cannot open input stream (file %s): %s"),
file_name, mu_strerror (rc));
mu_stream_destroy (&instream, mu_stream_get_owner (instream));
return NULL;
@@ -749,7 +749,7 @@ mh_real_install (char *name, int automode)
fp = fopen (name, "w");
if (!fp)
{
- mu_error (_("Cannot open file %s: %s"), name, mu_strerror (errno));
+ mu_error (_("cannot open file %s: %s"), name, mu_strerror (errno));
exit (1);
}
fprintf (fp, "Path: %s\n", mhdir);
@@ -785,7 +785,7 @@ mh_install (char *name, int automode)
}
else
{
- mu_error(_("Cannot stat %s: %s"), name, mu_strerror (errno));
+ mu_diag_funcall (MU_DIAG_ERROR, "stat", name, errno);
exit (1);
}
}
@@ -982,7 +982,7 @@ mh_draft_message (const char *name, const char *msgspec, char **pname)
{
rc = mu_mailbox_uidnext (mbox, &uid);
if (rc)
- mu_error (_("Cannot obtain sequence number for the new message: %s"),
+ mu_error (_("cannot obtain sequence number for the new message: %s"),
mu_strerror (rc));
}
else
@@ -994,7 +994,7 @@ mh_draft_message (const char *name, const char *msgspec, char **pname)
argv[1] = NULL;
rc = mh_msgset_parse (mbox, &msgset, 1, argv, "cur");
if (rc)
- mu_error (_("Invalid message number: %s"), msgspec);
+ mu_error (_("invalid message number: %s"), msgspec);
else if (msgset.count > 1)
mu_error (_("only one message at a time!"));
else
diff --git a/mh/mh_list.c b/mh/mh_list.c
index ac9fc5974..99f369e93 100644
--- a/mh/mh_list.c
+++ b/mh/mh_list.c
@@ -132,13 +132,15 @@ parse_cleartext (locus_t *loc, mu_list_t formlist, char *str)
static void
parse_component (locus_t *loc, mu_list_t formlist, char *compname, char *str)
{
+ int rc;
mhl_stmt_t *stmt = stmt_alloc (stmt_component);
stmt->v.component.name = compname;
- if (mu_list_create (&stmt->v.component.format))
+ if ((rc = mu_list_create (&stmt->v.component.format)) != 0)
{
- mu_error (_("%s:%d: cannot create list"),
+ mu_error ("%s:%d: mu_list_create: %s",
loc->filename,
- loc->line);
+ loc->line,
+ mu_strerror (rc));
exit (1); /* FIXME */
}
parse_variable (loc, stmt->v.component.format, str);
@@ -148,17 +150,18 @@ parse_component (locus_t *loc, mu_list_t formlist, char *compname, char *str)
static void
parse_variable (locus_t *loc, mu_list_t formlist, char *str)
{
- int i;
+ int i, rc;
int argc;
char **argv;
mh_format_t fmt;
- if (mu_argcv_get (str, ",=", NULL, &argc, &argv))
+ if ((rc = mu_argcv_get (str, ",=", NULL, &argc, &argv)) != 0)
{
- mu_error (_("%s:%d: cannot split string %s"),
+ mu_error ("%s:%d: mu_argcv_get(%s): %s",
loc->filename,
loc->line,
- str);
+ str,
+ mu_strerror (rc));
exit (1);
}
@@ -257,18 +260,19 @@ mhl_format_compile (char *name)
char *buf = NULL;
size_t n = 0;
locus_t loc;
+ int rc;
fp = fopen (name, "r");
if (!fp)
{
- mu_error (_("Cannot open file %s: %s"), name, mu_strerror (errno));
+ mu_error (_("cannot open file %s: %s"), name, mu_strerror (errno));
return NULL;
}
- if (mu_list_create (&formlist))
+ if ((rc = mu_list_create (&formlist)) != 0)
{
fclose (fp);
- mu_error (_("Cannot create list"));
+ mu_diag_funcall (MU_DIAG_ERROR, "mu_list_create", NULL, rc);
return NULL;
}
diff --git a/mh/mh_msgset.c b/mh/mh_msgset.c
index 07d74ffaf..a5f3dfaf9 100644
--- a/mh/mh_msgset.c
+++ b/mh/mh_msgset.c
@@ -40,7 +40,7 @@ _expand (size_t *msgcnt, size_t **msglist, size_t inc)
static void
msgset_abort (const char *arg)
{
- mu_error (_("Bad message list `%s'"), arg);
+ mu_error (_("bad message list `%s'"), arg);
exit (1);
}
@@ -62,7 +62,7 @@ msgset_last (mu_mailbox_t mbox, size_t *pnum)
rc = mu_mailbox_messages_count (mbox, &count);
if (rc)
{
- mu_error (_("Cannot get last message: %s"), mu_strerror (rc));
+ mu_error (_("cannot get last message: %s"), mu_strerror (rc));
exit (1);
}
*pnum = count;
@@ -162,7 +162,7 @@ msgset_preproc_part (mu_mailbox_t mbox, char *arg, char **rest)
rc = mu_mailbox_get_message (mbox, num, &msg);
if (rc)
{
- mu_error (_("Cannot get message %d: %s"), num, mu_strerror (rc));
+ mu_error (_("cannot get message %d: %s"), num, mu_strerror (rc));
exit (1);
}
*rest = arg + strlen (p->name);
@@ -603,7 +603,7 @@ mh_msgset_negate (mu_mailbox_t mbox, mh_msgset_t *msgset)
list = realloc (list, sizeof (list[0]) * msgno);
if (!list)
{
- mu_error (_("Not enough memory"));
+ mu_error (_("not enough memory"));
abort ();
}
mh_msgset_free (msgset);
diff --git a/mh/mh_whatnow.c b/mh/mh_whatnow.c
index 943af3e77..f8f5646e5 100644
--- a/mh/mh_whatnow.c
+++ b/mh/mh_whatnow.c
@@ -223,17 +223,17 @@ check_exit_status (const char *progname, int status)
{
if (WEXITSTATUS (status))
{
- mu_error (_("Command `%s' exited with status %d"),
+ mu_error (_("command `%s' exited with status %d"),
progname, WEXITSTATUS(status));
return 1;
}
return 0;
}
else if (WIFSIGNALED (status))
- mu_error (_("Command `%s' terminated on signal %d"),
+ mu_error (_("command `%s' terminated on signal %d"),
progname, WTERMSIG (status));
else
- mu_error (_("Command `%s' terminated abnormally"), progname);
+ mu_error (_("command `%s' terminated abnormally"), progname);
return 1;
}
diff --git a/mh/mh_whom.c b/mh/mh_whom.c
index b91d0add3..71d567c0b 100644
--- a/mh/mh_whom.c
+++ b/mh/mh_whom.c
@@ -35,7 +35,7 @@ addrcp (mu_list_t *list, char *addr, int isbcc)
p->isbcc = isbcc;
if (!*list && (rc = mu_list_create (list)))
{
- mu_error (_("Cannot create list: %s"), mu_strerror (rc));
+ mu_error (_("cannot create list: %s"), mu_strerror (rc));
exit (1);
}
mu_list_append (*list, p);
@@ -212,7 +212,7 @@ mh_whom (const char *filename, int check)
if (rc == ENOENT)
mu_error ("%s: %s", filename, mu_strerror (rc));
else
- mu_error ("%s: %s (%s)", filename, _("Malformed message"),
+ mu_error ("%s: %s (%s)", filename, _("malformed message"),
mu_strerror (rc));
rc = -1;
}
@@ -238,7 +238,7 @@ mh_whom (const char *filename, int check)
if (count == 0)
{
- mu_error(_("No recipients"));
+ mu_error(_("no recipients"));
rc = -1;
}
}
diff --git a/mh/mhl.c b/mh/mhl.c
index ebc23807e..e17acf84e 100644
--- a/mh/mhl.c
+++ b/mh/mhl.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007, 2008, 2009 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -110,7 +110,7 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
width = strtoul (arg, NULL, 0);
if (!width)
{
- argp_error (state, _("Invalid width"));
+ argp_error (state, _("invalid width"));
exit (1);
}
break;
@@ -119,7 +119,7 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
length = strtoul (arg, NULL, 0);
if (!length)
{
- argp_error (state, _("Invalid length"));
+ argp_error (state, _("invalid length"));
exit (1);
}
break;
@@ -163,13 +163,13 @@ open_output ()
if (rc)
{
- mu_error (_("Cannot create output stream: %s"), mu_strerror (rc));
+ mu_error (_("cannot create output stream: %s"), mu_strerror (rc));
exit (1);
}
if ((rc = mu_stream_open (output)))
{
- mu_error (_("Cannot open output stream: %s"), mu_strerror (rc));
+ mu_error (_("cannot open output stream: %s"), mu_strerror (rc));
exit (1);
}
return output;
@@ -188,13 +188,13 @@ list_message (char *name, mu_stream_t output)
rc = mu_file_stream_create (&input, name, MU_STREAM_READ);
if (rc)
{
- mu_error (_("Cannot create input stream: %s"), mu_strerror (rc));
+ mu_error (_("cannot create input stream: %s"), mu_strerror (rc));
return;
}
if ((rc = mu_stream_open (input)))
{
- mu_error (_("Cannot open input stream: %s"), mu_strerror (rc));
+ mu_error (_("cannot open input stream: %s"), mu_strerror (rc));
mu_stream_destroy (&input, mu_stream_get_owner (input));
return;
}
@@ -202,7 +202,7 @@ list_message (char *name, mu_stream_t output)
msg = mh_stream_to_message (input);
if (!msg)
{
- mu_error (_("Input stream %s is not a message (%s)"),
+ mu_error (_("input stream %s is not a message (%s)"),
name, mu_strerror (rc));
mu_stream_close (input);
mu_stream_destroy (&input, mu_stream_get_owner (input));
diff --git a/mh/mhn.c b/mh/mhn.c
index 7d6d409f4..f5a11111d 100644
--- a/mh/mhn.c
+++ b/mh/mhn.c
@@ -548,7 +548,7 @@ msg_part_parse (char *str)
str = endp;
break;
default:
- mu_error (_("Malformed part specification (near %s)"), endp);
+ mu_error (_("malformed part specification (near %s)"), endp);
exit (1);
}
msg_part_incr (p);
@@ -1280,14 +1280,14 @@ mhn_exec (mu_stream_t *str, const char *cmd, int flags)
int rc = mu_prog_stream_create (str, cmd, MU_STREAM_WRITE);
if (rc)
{
- mu_error (_("Cannot create proc stream (command %s): %s"),
+ mu_error (_("cannot create proc stream (command %s): %s"),
cmd, mu_strerror (rc));
}
else
{
rc = mu_stream_open (*str);
if (rc)
- mu_error (_("Cannot open proc stream (command %s): %s"),
+ mu_error (_("cannot open proc stream (command %s): %s"),
cmd, mu_strerror (rc));
}
return rc;
@@ -1328,14 +1328,14 @@ mhn_run_command (mu_message_t msg, msg_part_t part,
if (mu_argcv_get (cmd, "", "#", &argc, &argv))
{
- mu_error (_("Cannot parse command line `%s'"), cmd);
+ mu_error (_("cannot parse command line `%s'"), cmd);
return ENOSYS;
}
rc = mu_file_stream_create (&tmp, tempfile, MU_STREAM_RDWR);
if (rc)
{
- mu_error (_("Cannot create temporary stream (file %s): %s"),
+ mu_error (_("cannot create temporary stream (file %s): %s"),
tempfile, mu_strerror (rc));
mu_argcv_free (argc, argv);
return rc;
@@ -1343,7 +1343,7 @@ mhn_run_command (mu_message_t msg, msg_part_t part,
rc = mu_stream_open (tmp);
if (rc)
{
- mu_error (_("Cannot open temporary stream (file %s): %s"),
+ mu_error (_("cannot open temporary stream (file %s): %s"),
tempfile, mu_strerror (rc));
mu_stream_destroy (&tmp, mu_stream_get_owner (tmp));
mu_argcv_free (argc, argv);
@@ -1469,13 +1469,13 @@ mhn_show ()
rc = mu_stdio_stream_create (&ostr, stdout, 0);
if (rc)
{
- mu_error (_("Cannot create output stream: %s"), mu_strerror (rc));
+ mu_error (_("cannot create output stream: %s"), mu_strerror (rc));
exit (1);
}
rc = mu_stream_open (ostr);
if (rc)
{
- mu_error (_("Cannot open output stream: %s"), mu_strerror (rc));
+ mu_error (_("cannot open output stream: %s"), mu_strerror (rc));
exit (1);
}
@@ -1685,7 +1685,7 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding,
rc = mu_file_stream_create (&out, name, MU_STREAM_WRITE|MU_STREAM_CREAT);
if (rc)
{
- mu_error (_("Cannot create output stream (file %s): %s"),
+ mu_error (_("cannot create output stream (file %s): %s"),
name, mu_strerror (rc));
free (name);
return rc;
@@ -1693,7 +1693,7 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding,
rc = mu_stream_open (out);
if (rc)
{
- mu_error (_("Cannot open output stream (file %s): %s"),
+ mu_error (_("cannot open output stream (file %s): %s"),
name, mu_strerror (rc));
free (name);
mu_stream_destroy (&out, mu_stream_get_owner (out));
@@ -2113,7 +2113,7 @@ edit_extern (char *cmd, struct compose_env *env, mu_message_t *msg, int level)
if ((rc = mu_header_create (&hdr2, NULL, 0, NULL)) != 0)
{
- m