Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
54e51827
...
54e5182724214e3644aa010ed6edf827381175b6
authored
2006-05-17 09:41:36 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Remove mh_error function, use mu_error instead.
1 parent
d490b86d
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
217 additions
and
216 deletions
mh/ali.c
mh/burst.c
mh/comp.c
mh/compcommon.c
mh/fmtcheck.c
mh/folder.c
mh/forw.c
mh/inc.c
mh/mark.c
mh/mh_alias.l
mh/mh_alias.y
mh/mh_argp.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_stream.c
mh/mh_whatnow.c
mh/mh_whom.c
mh/mhl.c
mh/mhn.c
mh/pick.c
mh/pick.y
mh/refile.c
mh/repl.c
mh/rmf.c
mh/scan.c
mh/send.c
mh/sortm.c
mh/ali.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005
, 2006
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
...
...
@@ -229,7 +229,7 @@ main (int argc, char **argv)
{
if
(
argc
==
0
)
{
m
h
_error
(
"List of addresses is not given"
);
m
u
_error
(
"List of addresses is not given"
);
exit
(
1
);
}
else
...
...
mh/burst.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 2005
, 2006
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
...
...
@@ -251,7 +251,7 @@ flush_stream (mu_stream_t *pstr, char *buf, size_t size)
&&
((
rc
=
mu_temp_file_stream_create
(
pstr
,
NULL
))
!=
0
||
(
rc
=
mu_stream_open
(
*
pstr
))))
{
m
h
_error
(
_
(
"Cannot open temporary file: %s"
),
m
u
_error
(
_
(
"Cannot open temporary file: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
@@ -283,7 +283,7 @@ burst_digest (mu_message_t msg)
if
(
!
buf
)
{
m
h
_error
(
_
(
"cannot burst message: %s"
),
mu_strerror
(
ENOMEM
));
m
u
_error
(
_
(
"cannot burst message: %s"
),
mu_strerror
(
ENOMEM
));
exit
(
1
);
}
...
...
@@ -408,7 +408,7 @@ burst_or_copy (mu_message_t msg, int recursive, int copy)
rc
=
mu_mailbox_append_message
(
tmpbox
,
msg
);
if
(
rc
)
{
m
h
_error
(
_
(
"cannot append message: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"cannot append message: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
map
.
count
++
;
...
...
@@ -438,7 +438,7 @@ burst (mu_mailbox_t mbox, mu_message_t msg, size_t num, void *data)
}
}
else
if
(
!
quiet
)
m
h
_error
(
_
(
"message %s not in digest format"
),
mu_umaxtostr
(
0
,
num
));
m
u
_error
(
_
(
"message %s not in digest format"
),
mu_umaxtostr
(
0
,
num
));
}
...
...
@@ -474,7 +474,7 @@ burst_rename (mh_msgset_t *ms, size_t lastuid)
if
(
rename
(
from
,
to
))
{
m
h
_error
(
_
(
"error renaming %s to %s: %s"
),
m
u
_error
(
_
(
"error renaming %s to %s: %s"
),
from
,
to
,
mu_strerror
(
errno
));
exit
(
1
);
}
...
...
@@ -496,7 +496,7 @@ msg_copy (size_t num, char *file)
MU_STREAM_WRITE
|
MU_STREAM_CREAT
))
!=
0
||
(
rc
=
mu_stream_open
(
ostream
)))
{
m
h
_error
(
_
(
"Cannot open output file `%s': %s"
),
m
u
_error
(
_
(
"Cannot open output file `%s': %s"
),
file
,
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
@@ -615,7 +615,7 @@ main (int argc, char **argv)
VERBOSE
((
_
(
"changing to `%s'"
),
dir
+
3
));
if
(
chdir
(
dir
+
3
))
{
m
h
_error
(
_
(
"cannot change to `%s': %s"
),
dir
,
mu_strerror
(
errno
));
m
u
_error
(
_
(
"cannot change to `%s': %s"
),
dir
,
mu_strerror
(
errno
));
exit
(
1
);
}
mu_mailbox_close
(
mbox
);
...
...
mh/comp.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005
, 2006
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
...
...
@@ -179,7 +179,7 @@ copy_message (mu_mailbox_t mbox, size_t n, const char *file)
file
,
MU_STREAM_RDWR
|
MU_STREAM_CREAT
))
!=
0
||
(
rc
=
mu_stream_open
(
out
)))
{
m
h
_error
(
_
(
"cannot open output file
\"
%s
\"
: %s"
),
m
u
_error
(
_
(
"cannot open output file
\"
%s
\"
: %s"
),
file
,
mu_strerror
(
rc
));
free
(
buffer
);
return
1
;
...
...
@@ -191,7 +191,7 @@ copy_message (mu_mailbox_t mbox, size_t n, const char *file)
{
if
((
rc
=
mu_stream_sequential_write
(
out
,
buffer
,
rdsize
))
!=
0
)
{
m
h
_error
(
_
(
"error writing to
\"
%s
\"
: %s"
),
m
u
_error
(
_
(
"error writing to
\"
%s
\"
: %s"
),
file
,
mu_strerror
(
rc
));
break
;
}
...
...
@@ -245,7 +245,7 @@ main (int argc, char **argv)
mh_msgset_parse
(
mbox
,
&
msgset
,
argc
-
index
,
argv
+
index
,
"cur"
);
if
(
msgset
.
count
!=
1
)
{
m
h
_error
(
_
(
"only one message at a time!"
));
m
u
_error
(
_
(
"only one message at a time!"
));
return
1
;
}
copy_message
(
mbox
,
msgset
.
list
[
0
],
wh_env
.
file
);
...
...
mh/compcommon.c
View file @
54e5182
...
...
@@ -56,7 +56,7 @@ mh_comp_draft (char *formfile, char *defformfile, char *draftfile)
MU_STREAM_WRITE
|
MU_STREAM_CREAT
))
!=
0
||
(
rc
=
mu_stream_open
(
stream
)))
{
m
h
_error
(
_
(
"cannot open output file
\"
%s
\"
: %s"
),
m
u
_error
(
_
(
"cannot open output file
\"
%s
\"
: %s"
),
draftfile
,
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
@@ -69,7 +69,7 @@ mh_comp_draft (char *formfile, char *defformfile, char *draftfile)
if
(
rc
)
{
m
h
_error
(
_
(
"error writing to
\"
%s
\"
: %s"
),
m
u
_error
(
_
(
"error writing to
\"
%s
\"
: %s"
),
draftfile
,
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
mh/fmtcheck.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005,
2006 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
...
...
@@ -60,7 +61,7 @@ action_dump ()
{
if
(
!
format_str
)
{
m
h
_error
(
_
(
"Format string not specified"
));
m
u
_error
(
_
(
"Format string not specified"
));
return
1
;
}
mh_format_dump
(
&
format
);
...
...
@@ -112,7 +113,7 @@ main (int argc, char **argv)
if
(
format_str
&&
mh_format_parse
(
format_str
,
&
format
))
{
m
h
_error
(
_
(
"Bad format string"
));
m
u
_error
(
_
(
"Bad format string"
));
exit
(
1
);
}
return
(
*
action
)
();
...
...
mh/folder.c
View file @
54e5182
...
...
@@ -329,7 +329,7 @@ _scan (const char *name, size_t depth)
if
(
!
dir
)
{
m
h
_error
(
_
(
"Cannot scan folder %s: %s"
),
name
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot scan folder %s: %s"
),
name
,
strerror
(
errno
));
return
;
}
...
...
@@ -364,7 +364,7 @@ _scan (const char *name, size_t depth)
{
asprintf
(
&
p
,
"%s/%s"
,
name
,
entry
->
d_name
);
if
(
stat
(
p
,
&
st
)
<
0
)
m
h
_error
(
_
(
"Cannot stat %s: %s"
),
p
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot stat %s: %s"
),
p
,
strerror
(
errno
));
else
if
(
S_ISDIR
(
st
.
st_mode
))
{
info
.
others
++
;
...
...
@@ -624,7 +624,7 @@ pack_rename (struct pack_tab *tab, int reverse)
if
(
!
dry_run
)
{
if
((
rc
=
rename
(
from
,
to
)))
m
h
_error
(
_
(
"cannot rename `%s' to `%s': %s"
),
m
u
_error
(
_
(
"cannot rename `%s' to `%s': %s"
),
from
,
to
,
mu_strerror
(
errno
));
}
else
...
...
@@ -661,11 +661,11 @@ roll_back (const char *folder_name, struct pack_tab *pack_tab, size_t i)
return
;
start
=
i
-
1
;
m
h
_error
(
_
(
"Rolling back changes..."
));
m
u
_error
(
_
(
"Rolling back changes..."
));
while
(
--
i
>=
0
)
if
(
pack_rename
(
pack_tab
+
i
,
1
))
{
m
h
_error
(
_
(
"CRITICAL ERROR: Folder `%s' left in an inconsistent state, because an error
\n
"
m
u
_error
(
_
(
"CRITICAL ERROR: Folder `%s' left in an inconsistent state, because an error
\n
"
"occurred while trying to roll back the changes.
\n
"
"Message range %s-%s has been renamed to %s-%s."
),
folder_name
,
...
...
@@ -673,10 +673,10 @@ roll_back (const char *folder_name, struct pack_tab *pack_tab, size_t i)
mu_umaxtostr
(
1
,
pack_tab
[
start
].
orig
),
mu_umaxtostr
(
2
,
pack_tab
[
0
].
new
),
mu_umaxtostr
(
3
,
pack_tab
[
start
].
new
));
m
h
_error
(
_
(
"You will have to fix it manually."
));
m
u
_error
(
_
(
"You will have to fix it manually."
));
exit
(
1
);
}
m
h
_error
(
_
(
"Folder `%s' restored successfully"
),
folder_name
);
m
u
_error
(
_
(
"Folder `%s' restored successfully"
),
folder_name
);
}
struct
fixup_data
...
...
@@ -781,7 +781,7 @@ action_pack ()
/* Allocate pack table */
if
(
mu_mailbox_messages_count
(
mbox
,
&
count
))
{
m
h
_error
(
_
(
"Cannot read input mailbox: %s"
),
mu_strerror
(
errno
));
m
u
_error
(
_
(
"Cannot read input mailbox: %s"
),
mu_strerror
(
errno
));
return
1
;
}
pack_tab
=
xcalloc
(
count
,
sizeof
pack_tab
[
0
]);
/* Never freed. No use to
...
...
@@ -797,7 +797,7 @@ action_pack ()
status
=
mu_mailbox_get_message
(
mbox
,
i
+
1
,
&
msg
);
if
(
status
)
{
m
h
_error
(
_
(
"%d: cannot get message: %s"
),
i
,
mu_strerror
(
status
));
m
u
_error
(
_
(
"%d: cannot get message: %s"
),
i
,
mu_strerror
(
status
));
return
1
;
}
mh_message_number
(
msg
,
&
pack_tab
[
i
].
orig
);
...
...
@@ -829,7 +829,7 @@ action_pack ()
status
=
chdir
(
folder_dir
);
if
(
status
)
{
m
h
_error
(
_
(
"cannot change to directory `%s': %s"
),
m
u
_error
(
_
(
"cannot change to directory `%s': %s"
),
folder_dir
,
mu_strerror
(
status
));
return
1
;
}
...
...
@@ -901,7 +901,7 @@ main (int argc, char **argv)
}
else
if
(
argc
-
index
>
1
)
{
m
h
_error
(
_
(
"Too many arguments"
));
m
u
_error
(
_
(
"Too many arguments"
));
exit
(
1
);
}
...
...
mh/forw.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005
, 2006
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
...
...
@@ -341,7 +341,7 @@ finish_draft ()
MU_STREAM_WRITE
|
MU_STREAM_CREAT
))
!=
0
||
(
rc
=
mu_stream_open
(
stream
)))
{
m
h
_error
(
_
(
"Cannot open output file `%s': %s"
),
m
u
_error
(
_
(
"Cannot open output file `%s': %s"
),
wh_env
.
file
,
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
mh/inc.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2005 Free Software Foundation, Inc.
2005
, 2006
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
...
...
@@ -189,7 +189,7 @@ main (int argc, char **argv)
if
(
!
quiet
&&
mh_format_parse
(
format_str
,
&
format
))
{
m
h
_error
(
_
(
"Bad format string"
));
m
u
_error
(
_
(
"Bad format string"
));
exit
(
1
);
}
...
...
@@ -198,7 +198,7 @@ main (int argc, char **argv)
{
if
((
rc
=
mu_mailbox_create_default
(
&
input
,
NULL
))
!=
0
)
{
m
h
_error
(
_
(
"Cannot create default mailbox"
),
m
u
_error
(
_
(
"Cannot create default mailbox"
),
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
@@ -207,7 +207,7 @@ main (int argc, char **argv)
}
else
if
((
rc
=
mu_mailbox_create_default
(
&
input
,
input_file
))
!=
0
)
{
m
h
_error
(
_
(
"Cannot create mailbox %s: %s"
),
m
u
_error
(
_
(
"Cannot create mailbox %s: %s"
),
input_file
,
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
@@ -216,7 +216,7 @@ main (int argc, char **argv)
{
mu_url_t
url
;
mu_mailbox_get_url
(
input
,
&
url
);
m
h
_error
(
_
(
"Cannot open mailbox %s: %s"
),
m
u
_error
(
_
(
"Cannot open mailbox %s: %s"
),
mu_url_to_string
(
url
),
mu_strerror
(
errno
));
exit
(
1
);
...
...
@@ -224,14 +224,14 @@ main (int argc, char **argv)
if
((
rc
=
mu_mailbox_messages_count
(
input
,
&
total
))
!=
0
)
{
m
h
_error
(
_
(
"Cannot read input mailbox: %s"
),
mu_strerror
(
errno
));
m
u
_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
)
{
m
h
_error
(
_
(
"Cannot read output mailbox: %s"
),
m
u
_error
(
_
(
"Cannot read output mailbox: %s"
),
mu_strerror
(
errno
));
exit
(
1
);
}
...
...
@@ -252,14 +252,14 @@ main (int argc, char **argv)
if
((
rc
=
mu_mailbox_get_message
(
input
,
n
,
&
imsg
))
!=
0
)
{
m
h
_error
(
_
(
"%d: cannot get message: %s"
),
m
u
_error
(
_
(
"%d: cannot get message: %s"
),
n
,
mu_strerror
(
rc
));
continue
;
}
if
((
rc
=
mu_mailbox_append_message
(
output
,
imsg
))
!=
0
)
{
m
h
_error
(
_
(
"%d: error appending message: %s"
),
m
u
_error
(
_
(
"%d: error appending message: %s"
),
n
,
mu_strerror
(
rc
));
continue
;
}
...
...
mh/mark.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005
, 2006
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
...
...
@@ -70,7 +70,7 @@ add_sequence (char *name)
{
if
(
!
seq_list
&&
mu_list_create
(
&
seq_list
))
{
m
h
_error
(
_
(
"Cannot create sequence list"
));
m
u
_error
(
_
(
"Cannot create sequence list"
));
exit
(
1
);
}
mu_list_append
(
seq_list
,
name
);
...
...
@@ -216,7 +216,7 @@ main (int argc, char **argv)
case
ARG_ADD
:
if
(
!
seq_list
)
{
m
h
_error
(
_
(
"--add requires at least one --sequence argument"
));
m
u
_error
(
_
(
"--add requires at least one --sequence argument"
));
return
1
;
}
mu_list_do
(
seq_list
,
action_add
,
(
void
*
)
&
msgset
);
...
...
@@ -226,7 +226,7 @@ main (int argc, char **argv)
case
ARG_DELETE
:
if
(
!
seq_list
)
{
m
h
_error
(
_
(
"--delete requires at least one --sequence argument"
));
m
u
_error
(
_
(
"--delete requires at least one --sequence argument"
));
return
1
;
}
mu_list_do
(
seq_list
,
action_delete
,
(
void
*
)
&
msgset
);
...
...
mh/mh_alias.l
View file @
54e5182
%{
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005
, 2006
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
...
...
@@ -38,9 +38,9 @@ va_ali_parse_error_loc (char *name, size_t line, char *fmt, va_list ap)
vasprintf (&buf, fmt, ap);
if (name)
m
h
_error ("%s:%lu: %s", name, (unsigned long) line, buf);
m
u
_error ("%s:%lu: %s", name, (unsigned long) line, buf);
else
m
h
_error ("%s", buf);
m
u
_error ("%s", buf);
free (buf);
}
...
...
mh/mh_alias.y
View file @
54e5182
...
...
@@ -382,7 +382,7 @@ mh_alias_get_address (char *name, mu_address_t *paddr, int *incl)
mu_iterator_current (itr, (void **)&item);
if (mu_address_create (&a, item))
{
m
h
_error (_("Error expanding aliases -- invalid address `%s'"),
m
u
_error (_("Error expanding aliases -- invalid address `%s'"),
item);
}
else
...
...
mh/mh_argp.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2005,
2006 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
...
...
@@ -170,7 +171,7 @@ mh_argp_parse (int *pargc, char **pargv[],
*
pindex
=
index
;
else
if
(
extra
)
{
m
h
_error
(
_
(
"Extra arguments"
));
m
u
_error
(
_
(
"Extra arguments"
));
exit
(
1
);
}
mh_init2
();
...
...
mh/mh_ctx.c
View file @
54e5182
...
...
@@ -143,7 +143,7 @@ mh_context_write (mh_context_t *ctx)
fp
=
fopen
(
ctx
->
name
,
"w"
);
if
(
!
fp
)
{
m
h
_error
(
_
(
"Cannot open context file %s: %s"
),
m
u
_error
(
_
(
"Cannot open context file %s: %s"
),
ctx
->
name
,
strerror
(
errno
));
return
MU_ERR_FAILURE
;
}
...
...
@@ -193,7 +193,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
)
{
m
h
_error
(
_
(
"Cannot create context %s: %s"
),
m
u
_error
(
_
(
"Cannot create context %s: %s"
),
ctx
->
name
,
mu_strerror
(
rc
));
return
1
;
...
...
mh/mh_fmtgram.y
View file @
54e5182
...
...
@@ -206,7 +206,7 @@ function : FUNCTION
else
{
yyerror (_("undefined function"));
m
h
_error ($1);
m
u
_error ($1);
YYERROR;
}
}
...
...
@@ -357,9 +357,9 @@ int
yyerror (char *s)
{
int len;
m
h
_error ("%s: %s", start, s);
m
u
_error ("%s: %s", start, s);
len = curp - start;
m
h
_error ("%*.*s^", len, len, "");
m
u
_error ("%*.*s^", len, len, "");
return 0;
}
...
...
@@ -637,7 +637,7 @@ mh_code_builtin (mh_builtin_t *bp, int argtype)
}
else
{
m
h
_error (_("Missing argument for %s"), bp->name);
m
u
_error (_("Missing argument for %s"), bp->name);
return 0;
}
}
...
...
@@ -646,7 +646,7 @@ mh_code_builtin (mh_builtin_t *bp, int argtype)
switch (bp->argtype)
{
case mhtype_none:
m
h
_error (_("Extra arguments to %s"), bp->name);
m
u
_error (_("Extra arguments to %s"), bp->name);
return 0;
case mhtype_num:
...
...
mh/mh_format.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2005 Free Software Foundation, Inc.
2005
, 2006
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
...
...
@@ -601,7 +601,7 @@ mh_format (mh_format_t *fmt, mu_message_t msg, size_t msgno,
break
;
default:
m
h
_error
(
_
(
"INTERNAL ERROR: Unknown opcode: %x"
),
opcode
);
m
u
_error
(
_
(
"INTERNAL ERROR: Unknown opcode: %x"
),
opcode
);
abort
();
}
}
...
...
@@ -807,7 +807,7 @@ mh_format_dump (mh_format_t *fmt)
break
;
default:
m
h
_error
(
"Unknown opcode: %x"
,
opcode
);
m
u
_error
(
"Unknown opcode: %x"
,
opcode
);
abort
();
}
printf
(
"
\n
"
);
...
...
@@ -831,7 +831,7 @@ mh_format_free (mh_format_t *fmt)
static
void
builtin_not_implemented
(
char
*
name
)
{
m
h
_error
(
"%s is not yet implemented."
,
name
);
m
u
_error
(
"%s is not yet implemented."
,
name
);
}
static
void
...
...
@@ -944,7 +944,7 @@ builtin_divide (struct mh_machine *mach)
if
(
!
mach
->
arg_num
)
{
/* TRANSLATORS: Do not translate the word 'format'! */
m
h
_error
(
_
(
"format: divide by zero"
));
m
u
_error
(
_
(
"format: divide by zero"
));
mach
->
stop
=
1
;
}
else
...
...
@@ -956,7 +956,7 @@ builtin_modulo (struct mh_machine *mach)
{
if
(
!
mach
->
arg_num
)
{
m
h
_error
(
_
(
"format: divide by zero"
));
m
u
_error
(
_
(
"format: divide by zero"
));
mach
->
stop
=
1
;
}
else
...
...
@@ -1091,7 +1091,7 @@ _parse_date (struct mh_machine *mach, struct tm *tm, mu_timezone *tz)
{
time_t
t
;
/*m
h
_error ("can't parse date: [%s]", date);*/
/*m
u
_error ("can't parse date: [%s]", date);*/
time
(
&
t
);
*
tm
=
*
localtime
(
&
t
);
tz
->
utc_offset
=
mu_utc_offset
();
...
...
@@ -1873,7 +1873,7 @@ builtin_rcpt (struct mh_machine *mach)
int
rc
=
mh_decode_rcpt_flag
(
strobj_ptr
(
&
mach
->
arg_str
));
if
(
rc
==
RCPT_NONE
)
{
m
h
_error
(
_
(
"Invalid recipient mask"
));
m
u
_error
(
_
(
"Invalid recipient mask"
));
/* try to continue anyway */
}
mach
->
arg_num
=
rc
&
rcpt_mask
;
...
...
mh/mh_init.c
View file @
54e5182
...
...
@@ -39,6 +39,14 @@ char mh_list_format[] =
"%<(zero)%17(friendly{from})%>"
" %{subject}%<{body}<<%{body}>>%>"
;
static
int
mu_error_printer
(
const
char
*
fmt
,
va_list
ap
)
{
fprintf
(
stderr
,
"%s: "
,
program_invocation_short_name
);
vfprintf
(
stderr
,
fmt
,
ap
);
fprintf
(
stderr
,
"
\n
"
);
return
0
;
}
void
mh_init
()
...
...
@@ -46,6 +54,8 @@ mh_init ()
/* Register all mailbox and mailer formats */
mu_register_all_formats
();
mu_error_set_print
(
mu_error_printer
);
/* Read user's profile */
mh_read_profile
();
}
...
...
@@ -68,14 +78,14 @@ mh_read_formfile (char *name, char **pformat)
if
(
stat
(
name
,
&
st
))
{
m
h
_error
(
_
(
"Cannot stat format file %s: %s"
),
name
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot stat format file %s: %s"
),
name
,
strerror
(
errno
));
return
-
1
;
}
fp
=
fopen
(
name
,
"r"
);
if
(
!
fp
)
{
m
h
_error
(
_
(
"Cannot open format file %s: %s"
),
name
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot open format file %s: %s"
),
name
,
strerror
(
errno
));
return
-
1
;
}
...
...
@@ -110,7 +120,7 @@ mh_read_formfile (char *name, char **pformat)
void
mh_err_memory
(
int
fatal
)
{
m
h
_error
(
_
(
"Not enough memory"
));
m
u
_error
(
_
(
"Not enough memory"
));
if
(
fatal
)
abort
();
}
...
...
@@ -126,7 +136,7 @@ mh_get_my_name (char *name)
struct
passwd
*
pw
=
getpwuid
(
getuid
());
if
(
!
pw
)
{
m
h
_error
(
_
(
"Cannot determine my username"
));
m
u
_error
(
_
(
"Cannot determine my username"
));
return
;
}
name
=
pw
->
pw_name
;
...
...
@@ -228,12 +238,12 @@ make_dir_hier (const char *p, mode_t perm)
{
if
(
errno
!=
ENOENT
)
{
m
h
_error
(
_
(
"Cannot create directory %s: error accessing name component %s: %s"
),
m
u
_error
(
_
(
"Cannot create directory %s: error accessing name component %s: %s"
),
dir
,
strerror
(
errno
));
rc
=
1
;
}
else
if
((
rc
=
mkdir
(
dir
,
perm
)))
m
h
_error
(
_
(
"Cannot create directory %s: error creating name component %s: %s"
),
m
u
_error
(
_
(
"Cannot create directory %s: error creating name component %s: %s"
),
dir
,
rc
);
}
*
q
=
'/'
;
...
...
@@ -258,7 +268,7 @@ mh_makedir (char *p)
{
rc
=
mkdir
(
p
,
perm
);
if
(
rc
)
m
h
_error
(
_
(
"Cannot create directory %s: %s"
),
m
u
_error
(
_
(
"Cannot create directory %s: %s"
),
p
,
strerror
(
errno
));
}
...
...
@@ -288,7 +298,7 @@ mh_check_folder (char *pathname, int confirm)
}
else
{
m
h
_error
(
_
(
"Cannot stat %s: %s"
),
p
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot stat %s: %s"
),
p
,
strerror
(
errno
));
return
1
;
}
}
...
...
@@ -379,7 +389,7 @@ mh_audit_open (char *name, mu_mailbox_t mbox)
asprintf
(
&
p
,
"%s/%s"
,
mu_folder_directory
(),
namep
);
if
(
!
p
)
{
m
h
_error
(
_
(
"Not enough memory"
));
m
u
_error
(
_
(
"Not enough memory"
));
exit
(
1
);
}
free
(
namep
);
...
...
@@ -389,7 +399,7 @@ mh_audit_open (char *name, mu_mailbox_t mbox)
fp
=
fopen
(
namep
,
"a"
);
if
(
!
fp
)
{
m
h
_error
(
_
(
"Cannot open audit file %s: %s"
),
namep
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot open audit file %s: %s"
),
namep
,
strerror
(
errno
));
free
(
namep
);
return
NULL
;
}
...
...
@@ -432,7 +442,7 @@ mh_open_folder (const char *folder, int create)
if
(
mu_mailbox_create_default
(
&
mbox
,
name
))
{
m
h
_error
(
_
(
"Cannot create mailbox %s: %s"
),
m
u
_error
(
_
(
"Cannot create mailbox %s: %s"
),
name
,
strerror
(
errno
));
exit
(
1
);
}
...
...
@@ -442,7 +452,7 @@ mh_open_folder (const char *folder, int create)
if
(
mu_mailbox_open
(
mbox
,
flags
))
{
m
h
_error
(
_
(
"Cannot open mailbox %s: %s"
),
name
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot open mailbox %s: %s"
),
name
,
strerror
(
errno
));
exit
(
1
);
}
...
...
@@ -518,7 +528,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
)
{
m
h
_error
(
_
(
"Cannot get message %d: %s"
),
num
,
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot get message %d: %s"
),
num
,
mu_strerror
(
rc
));
return
1
;
}
...
...
@@ -536,7 +546,7 @@ mh_spawnp (const char *prog, const char *file)
if
(
mu_argcv_get
(
prog
,
""
,
"#"
,
&
argc
,
&
argv
))
{
m
h
_error
(
_
(
"Cannot split line %s"
),
prog
);
m
u
_error
(
_
(
"Cannot split line %s"
),
prog
);
mu_argcv_free
(
argc
,
argv
);
return
1
;
}
...
...
@@ -574,7 +584,7 @@ mh_file_copy (const char *from, const char *to)
if
(
stat
(
from
,
&
st
))
{
m
h
_error
(
"mh_copy: %s"
,
mu_strerror
(
errno
));
m
u
_error
(
"mh_copy: %s"
,
mu_strerror
(
errno
));
return
-
1
;
}
...
...
@@ -588,7 +598,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
)))
{
m
h
_error
(
_
(
"Cannot open input file `%s': %s"
),
m
u
_error
(
_
(
"Cannot open input file `%s': %s"
),
from
,
mu_strerror
(
rc
));
free
(
buffer
);
return
1
;
...
...
@@ -597,7 +607,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
)))
{
m
h
_error
(
_
(
"Cannot open output file `%s': %s"
),
m
u
_error
(
_
(
"Cannot open output file `%s': %s"
),
to
,
mu_strerror
(
rc
));
free
(
buffer
);
mu_stream_close
(
in
);
...
...
@@ -611,7 +621,7 @@ mh_file_copy (const char *from, const char *to)
{
if
((
rc
=
mu_stream_sequential_write
(
out
,
buffer
,
rdsize
))
!=
0
)
{
m
h
_error
(
_
(
"Write error on `%s': %s"
),
m
u
_error
(
_
(
"Write error on `%s': %s"
),
to
,
mu_strerror
(
rc
));
break
;
}
...
...
@@ -640,20 +650,20 @@ mh_file_to_message (const char *folder, char *file_name)
if
(
stat
(
file_name
,
&
st
)
<
0
)
{
m
h
_error
(
_
(
"Cannot stat file %s: %s"
),
file_name
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot stat file %s: %s"
),
file_name
,
strerror
(
errno
));
return
NULL
;
}
if
((
rc
=
mu_file_stream_create
(
&
instream
,
file_name
,
MU_STREAM_READ
)))
{
m
h
_error
(
_
(
"Cannot create input stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot create input stream (file %s): %s"
),
file_name
,
mu_strerror
(
rc
));
return
NULL
;
}
if
((
rc
=
mu_stream_open
(
instream
)))
{
m
h
_error
(
_
(
"Cannot open input stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot open input stream (file %s): %s"
),
file_name
,
mu_strerror
(
rc
));
mu_stream_destroy
(
&
instream
,
mu_stream_get_owner
(
instream
));
return
NULL
;
...
...
@@ -765,7 +775,7 @@ mh_install (char *name, int automode)
}
else
{
m
h
_error
(
_
(
"Cannot stat %s: %s"
),
name
,
mu_strerror
(
errno
));
m
u
_error
(
_
(
"Cannot stat %s: %s"
),
name
,
mu_strerror
(
errno
));
exit
(
1
);
}
}
...
...
@@ -851,7 +861,7 @@ mh_set_reply_regex (const char *str)
char
*
err
;
int
rc
=
mu_unre_set_regex
(
str
,
0
,
&
err
);
if
(
rc
)
m
h
_error
(
"reply_regex: %s%s%s"
,
mu_strerror
(
rc
),
m
u
_error
(
"reply_regex: %s%s%s"
,
mu_strerror
(
rc
),
err
?
": "
:
""
,
err
?
err
:
""
);
}
...
...
@@ -1019,14 +1029,3 @@ mh_draft_message (const char *name, const char *msgspec, char **pname)
mu_mailbox_destroy
(
&
mbox
);
return
rc
;
}
void
mh_error
(
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
fprintf
(
stderr
,
"%s: "
,
program_invocation_short_name
);
vfprintf
(
stderr
,
fmt
,
ap
);
fprintf
(
stderr
,
"
\n
"
);
va_end
(
ap
);
}
...
...
mh/mh_list.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005
, 2006
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
...
...
@@ -136,7 +136,7 @@ parse_component (locus_t *loc, mu_list_t formlist, char *compname, char *str)
stmt
->
v
.
component
.
name
=
compname
;
if
(
mu_list_create
(
&
stmt
->
v
.
component
.
format
))
{
m
h
_error
(
_
(
"%s:%d: cannot create list"
),
m
u
_error
(
_
(
"%s:%d: cannot create list"
),
loc
->
filename
,
loc
->
line
);
exit
(
1
);
/* FIXME */
...
...
@@ -155,7 +155,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
if
(
mu_argcv_get
(
str
,
",="
,
NULL
,
&
argc
,
&
argv
))
{
m
h
_error
(
_
(
"%s:%d: cannot split string %s"
),
m
u
_error
(
_
(
"%s:%d: cannot split string %s"
),
loc
->
filename
,
loc
->
line
,
str
);
...
...
@@ -172,7 +172,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
var
=
variable_lookup
(
name
);
if
(
!
var
)
{
m
h
_error
(
_
(
"%s:%d: unknown variable: %s"
),
m
u
_error
(
_
(
"%s:%d: unknown variable: %s"
),
loc
->
filename
,
loc
->
line
,
argv
[
i
]);
...
...
@@ -188,7 +188,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
if
((
var
->
type
==
dt_flag
&&
value
)
||
(
var
->
type
!=
dt_flag
&&
!
value
))
{
m
h
_error
(
_
(
"%s:%d: wrong datatype for %s"
),
m
u
_error
(
_
(
"%s:%d: wrong datatype for %s"
),
loc
->
filename
,
loc
->
line
,
var
->
name
);
...
...
@@ -208,7 +208,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
case
dt_format
:
if
(
mh_format_parse
(
value
,
&
fmt
))
{
m
h
_error
(
_
(
"%s:%d: bad format string"
),
m
u
_error
(
_
(
"%s:%d: bad format string"
),
loc
->
filename
,
loc
->
line
);
exit
(
1
);
...
...
@@ -227,7 +227,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
i
++
;
if
(
i
<
argc
&&
argv
[
i
][
0
]
!=
','
)
{
m
h
_error
(
_
(
"%s:%d: syntax error"
),
loc
->
filename
,
loc
->
line
);
m
u
_error
(
_
(
"%s:%d: syntax error"
),
loc
->
filename
,
loc
->
line
);
exit
(
1
);
}
}
...
...
@@ -261,14 +261,14 @@ mhl_format_compile (char *name)
fp
=
fopen
(
name
,
"r"
);
if
(
!
fp
)
{
m
h
_error
(
_
(
"Cannot open file %s: %s"
),
name
,
mu_strerror
(
errno
));
m
u
_error
(
_
(
"Cannot open file %s: %s"
),
name
,
mu_strerror
(
errno
));
return
NULL
;
}
if
(
mu_list_create
(
&
formlist
))
{
fclose
(
fp
);
m
h
_error
(
_
(
"Cannot create list"
));
m
u
_error
(
_
(
"Cannot create list"
));
return
NULL
;
}
...
...
mh/mh_msgset.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2005
, 2006
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
...
...
@@ -39,7 +39,7 @@ _expand (size_t *msgcnt, size_t **msglist, size_t inc)
static
void
msgset_abort
(
const
char
*
arg
)
{
m
h
_error
(
_
(
"Bad message list `%s'"
),
arg
);
m
u
_error
(
_
(
"Bad message list `%s'"
),
arg
);
exit
(
1
);
}
...
...
@@ -61,7 +61,7 @@ msgset_last (mu_mailbox_t mbox, size_t *pnum)
rc
=
mu_mailbox_messages_count
(
mbox
,
&
count
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot get last message: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot get last message: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
*
pnum
=
count
;
...
...
@@ -94,7 +94,7 @@ msgset_cur (mu_mailbox_t mbox, size_t *pnum)
return
0
;
}
}
m
h
_error
(
_
(
"no cur message"
));
m
u
_error
(
_
(
"no cur message"
));
exit
(
1
);
}
...
...
@@ -105,7 +105,7 @@ msgset_prev (mu_mailbox_t mbox, size_t *pnum)
msgset_cur
(
mbox
,
&
cur_n
);
if
(
cur_n
<
1
)
{
m
h
_error
(
_
(
"no prev message"
));
m
u
_error
(
_
(
"no prev message"
));
exit
(
1
);
}
*
pnum
=
cur_n
-
1
;
...
...
@@ -120,7 +120,7 @@ msgset_next (mu_mailbox_t mbox, size_t *pnum)
mu_mailbox_messages_count
(
mbox
,
&
total
);
if
(
cur_n
+
1
>
total
)
{
m
h
_error
(
_
(
"no next message"
));
m
u
_error
(
_
(
"no next message"
));
exit
(
1
);
}
*
pnum
=
cur_n
+
1
;
...
...
@@ -161,7 +161,7 @@ msgset_preproc_part (mu_mailbox_t mbox, char *arg, char **rest)
rc
=
mu_mailbox_get_message
(
mbox
,
num
,
&
msg
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot get message %d: %s"
),
num
,
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot get message %d: %s"
),
num
,
mu_strerror
(
rc
));
exit
(
1
);
}
*
rest
=
arg
+
strlen
(
p
->
name
);
...
...
@@ -330,7 +330,7 @@ _mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset, int argc, char **argv)
if
(
expand_user_seq
(
mbox
,
&
m
,
arg
))
{
m
h
_error
(
_
(
"message set %s does not exist"
),
arg
);
m
u
_error
(
_
(
"message set %s does not exist"
),
arg
);
exit
(
1
);
}
_expand
(
&
msgcnt
,
&
msglist
,
m
.
count
);
...
...
@@ -347,7 +347,7 @@ _mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset, int argc, char **argv)
n
=
mh_get_message
(
mbox
,
start
,
NULL
);
if
(
!
n
)
{
m
h
_error
(
_
(
"message %d does not exist"
),
start
);
m
u
_error
(
_
(
"message %d does not exist"
),
start
);
exit
(
1
);
}
msglist
[
msgno
++
]
=
n
;
...
...
@@ -373,7 +373,7 @@ _mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset, int argc, char **argv)
}
if
(
msgno
==
msg_first
)
{
m
h
_error
(
_
(
"no messages in range %s"
),
argv
[
i
]);
m
u
_error
(
_
(
"no messages in range %s"
),
argv
[
i
]);
exit
(
1
);
}
break
;
...
...
@@ -407,7 +407,7 @@ _mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset, int argc, char **argv)
}
if
(
msgno
==
msg_first
)
{
m
h
_error
(
_
(
"no messages in range %s"
),
argv
[
i
]);
m
u
_error
(
_
(
"no messages in range %s"
),
argv
[
i
]);
exit
(
1
);
}
break
;
...
...
@@ -601,7 +601,7 @@ mh_msgset_negate (mu_mailbox_t mbox, mh_msgset_t *msgset)
list
=
realloc
(
list
,
sizeof
(
list
[
0
])
*
msgno
);
if
(
!
list
)
{
m
h
_error
(
_
(
"Not enough memory"
));
m
u
_error
(
_
(
"Not enough memory"
));
abort
();
}
mh_msgset_free
(
msgset
);
...
...
mh/mh_stream.c
View file @
54e5182
...
...
@@ -34,7 +34,7 @@ mh_stream_to_message (mu_stream_t instream)
rc
=
mu_stream_to_message
(
instream
,
&
msg
);
if
(
rc
)
{
m
h
_error
(
_
(
"cannot open draft message stream: %s"
),
m
u
_error
(
_
(
"cannot open draft message stream: %s"
),
mu_strerror
(
rc
));
return
NULL
;
}
...
...
mh/mh_whatnow.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005
, 2006
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
...
...
@@ -55,7 +55,7 @@ func (struct action_tab *p, const char *name)
return
p
->
fp
;
}
m
h
_error
(
_
(
"%s is unknown. Hit <CR> for help"
),
name
);
m
u
_error
(
_
(
"%s is unknown. Hit <CR> for help"
),
name
);
return
NULL
;
}
...
...
@@ -195,13 +195,13 @@ display_file (const char *name)
rc
=
mu_file_stream_create
(
&
stream
,
name
,
MU_STREAM_READ
);
if
(
rc
)
{
m
h
_error
(
"mu_file_stream_create: %s"
,
mu_strerror
(
rc
));
m
u
_error
(
"mu_file_stream_create: %s"
,
mu_strerror
(
rc
));
return
;
}
rc
=
mu_stream_open
(
stream
);
if
(
rc
)
{
m
h
_error
(
"mu_stream_open: %s"
,
mu_strerror
(
rc
));
m
u
_error
(
"mu_stream_open: %s"
,
mu_strerror
(
rc
));
return
;
}
...
...
@@ -223,17 +223,17 @@ check_exit_status (char *progname, int status)
{
if
(
WEXITSTATUS
(
status
))
{
m
h
_error
(
_
(
"Command `%s' exited with status %d"
),
m
u
_error
(
_
(
"Command `%s' exited with status %d"
),
progname
,
WEXITSTATUS
(
status
));
return
1
;
}
return
0
;
}
else
if
(
WIFSIGNALED
(
status
))
m
h
_error
(
_
(
"Command `%s' terminated on signal %d"
),
m
u
_error
(
_
(
"Command `%s' terminated on signal %d"
),
progname
,
WTERMSIG
(
status
));
else
m
h
_error
(
_
(
"Command `%s' terminated abnormally"
),
progname
);
m
u
_error
(
_
(
"Command `%s' terminated abnormally"
),
progname
);
return
1
;
}
...
...
@@ -371,7 +371,7 @@ static int
display
(
struct
mh_whatnow_env
*
wh
,
int
argc
,
char
**
argv
,
int
*
status
)
{
if
(
!
wh
->
msg
)
m
h
_error
(
_
(
"no alternate message to display"
));
m
u
_error
(
_
(
"no alternate message to display"
));
else
display_file
(
wh
->
msg
);
return
0
;
...
...
@@ -395,7 +395,7 @@ static int
list
(
struct
mh_whatnow_env
*
wh
,
int
argc
,
char
**
argv
,
int
*
status
)
{
if
(
!
wh
->
file
)
m
h
_error
(
_
(
"no draft file to display"
));
m
u
_error
(
_
(
"no draft file to display"
));
else
display_file
(
wh
->
file
);
return
0
;
...
...
@@ -453,7 +453,7 @@ static int
whom
(
struct
mh_whatnow_env
*
wh
,
int
argc
,
char
**
argv
,
int
*
status
)
{
if
(
!
wh
->
file
)
m
h
_error
(
_
(
"no draft file to display"
));
m
u
_error
(
_
(
"no draft file to display"
));
else
mh_whom
(
wh
->
file
,
(
argc
==
2
&&
(
strcmp
(
argv
[
1
],
"-check"
)
==
0
...
...
mh/mh_whom.c
View file @
54e5182
...
...
@@ -35,7 +35,7 @@ addrcp (mu_list_t *list, char *addr, int isbcc)
p
->
isbcc
=
isbcc
;
if
(
!*
list
&&
(
rc
=
mu_list_create
(
list
)))
{
m
h
_error
(
_
(
"Cannot create list: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot create list: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
mu_list_append
(
*
list
,
p
);
...
...
@@ -106,7 +106,7 @@ mh_alias_expand (char *str, mu_address_t *paddr, int *incl)
int
status
;
mu_argcv_string
(
argc
,
argv
,
&
buf
);
if
(
status
=
mu_address_create
(
paddr
,
buf
))
m
h
_error
(
_
(
"Bad address `%s': %s"
),
buf
,
mu_strerror
(
status
));
m
u
_error
(
_
(
"Bad address `%s': %s"
),
buf
,
mu_strerror
(
status
));
free
(
buf
);
}
...
...
@@ -141,7 +141,7 @@ scan_addrs (char *str, int isbcc)
rc
=
mu_address_aget_email
(
addr
,
i
,
&
buf
);
if
(
rc
)
{
m
h
_error
(
"mu_address_aget_email: %s"
,
mu_strerror
(
rc
));
m
u
_error
(
"mu_address_aget_email: %s"
,
mu_strerror
(
rc
));
continue
;
}
...
...
@@ -227,7 +227,7 @@ mh_whom (char *filename, int check)
ctx
=
mh_context_create
(
filename
,
1
);
if
(
mh_context_read
(
ctx
))
{
m
h
_error
(
_
(
"Malformed message"
));
m
u
_error
(
_
(
"Malformed message"
));
rc
=
-
1
;
}
else
...
...
@@ -252,7 +252,7 @@ mh_whom (char *filename, int check)
if
(
count
==
0
)
{
m
h
_error
(
_
(
"No recipients"
));
m
u
_error
(
_
(
"No recipients"
));
rc
=
-
1
;
}
}
...
...
mh/mhl.c
View file @
54e5182
...
...
@@ -165,13 +165,13 @@ open_output ()
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot create output stream: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot create output stream: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
if
((
rc
=
mu_stream_open
(
output
)))
{
m
h
_error
(
_
(
"Cannot open output stream: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot open output stream: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
return
output
;
...
...
@@ -190,13 +190,13 @@ list_message (char *name, mu_stream_t output)
rc
=
mu_file_stream_create
(
&
input
,
name
,
MU_STREAM_READ
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot create input stream: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot create input stream: %s"
),
mu_strerror
(
rc
));
return
;
}
if
((
rc
=
mu_stream_open
(
input
)))
{
m
h
_error
(
_
(
"Cannot open input stream: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot open input stream: %s"
),
mu_strerror
(
rc
));
mu_stream_destroy
(
&
input
,
mu_stream_get_owner
(
input
));
return
;
}
...
...
@@ -204,7 +204,7 @@ list_message (char *name, mu_stream_t output)
msg
=
mh_stream_to_message
(
input
);
if
(
!
msg
)
{
m
h
_error
(
_
(
"Input stream %s is not a message (%s)"
),
m
u
_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
));
...
...
mh/mhn.c
View file @
54e5182
...
...
@@ -549,7 +549,7 @@ msg_part_parse (char *str)
str
=
endp
;
break
;
default:
m
h
_error
(
_
(
"Malformed part specification (near %s)"
),
endp
);
m
u
_error
(
_
(
"Malformed part specification (near %s)"
),
endp
);
exit
(
1
);
}
msg_part_incr
(
p
);
...
...
@@ -1262,7 +1262,7 @@ show_internal (mu_message_t msg, msg_part_t part, char *encoding, mu_stream_t ou
if
((
rc
=
mu_message_get_body
(
msg
,
&
body
)))
{
m
h
_error
(
_
(
"%s: cannot get message body: %s"
),
m
u
_error
(
_
(
"%s: cannot get message body: %s"
),
mu_umaxtostr
(
0
,
msg_part_subpart
(
part
,
0
)),
mu_strerror
(
rc
));
return
0
;
...
...
@@ -1284,14 +1284,14 @@ mhn_exec (mu_stream_t *str, char *cmd, int flags)
int
rc
=
mu_prog_stream_create
(
str
,
cmd
,
MU_STREAM_WRITE
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot create proc stream (command %s): %s"
),
m
u
_error
(
_
(
"Cannot create proc stream (command %s): %s"
),
cmd
,
mu_strerror
(
rc
));
}
else
{
rc
=
mu_stream_open
(
*
str
);
if
(
rc
)
m
h
_error
(
_
(
"Cannot open proc stream (command %s): %s"
),
m
u
_error
(
_
(
"Cannot open proc stream (command %s): %s"
),
cmd
,
mu_strerror
(
rc
));
}
return
rc
;
...
...
@@ -1332,14 +1332,14 @@ mhn_run_command (mu_message_t msg, msg_part_t part,
if
(
mu_argcv_get
(
cmd
,
""
,
"#"
,
&
argc
,
&
argv
))
{
m
h
_error
(
_
(
"Cannot parse command line `%s'"
),
cmd
);
m
u
_error
(
_
(
"Cannot parse command line `%s'"
),
cmd
);
return
ENOSYS
;
}
rc
=
mu_file_stream_create
(
&
tmp
,
tempfile
,
MU_STREAM_RDWR
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot create temporary stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot create temporary stream (file %s): %s"
),
tempfile
,
mu_strerror
(
rc
));
mu_argcv_free
(
argc
,
argv
);
return
rc
;
...
...
@@ -1347,7 +1347,7 @@ mhn_run_command (mu_message_t msg, msg_part_t part,
rc
=
mu_stream_open
(
tmp
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot open temporary stream (file %s): %s"
),
m
u
_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
);
...
...
@@ -1473,13 +1473,13 @@ mhn_show ()
rc
=
mu_stdio_stream_create
(
&
ostr
,
stdout
,
0
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot create output stream: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot create output stream: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
rc
=
mu_stream_open
(
ostr
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot open output stream: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot open output stream: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
@@ -1688,7 +1688,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
)
{
m
h
_error
(
_
(
"Cannot create output stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot create output stream (file %s): %s"
),
name
,
mu_strerror
(
rc
));
free
(
name
);
return
rc
;
...
...
@@ -1696,7 +1696,7 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding,
rc
=
mu_stream_open
(
out
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot open output stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot open output stream (file %s): %s"
),
name
,
mu_strerror
(
rc
));
free
(
name
);
mu_stream_destroy
(
&
out
,
mu_stream_get_owner
(
out
));
...
...
@@ -1810,7 +1810,7 @@ parse_brace (char **pval, char **cmd, int c, struct compose_env *env)
if
(
!
sp
)
{
m
h
_error
(
_
(
"%s:%lu: missing %c"
),
m
u
_error
(
_
(
"%s:%lu: missing %c"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
),
c
);
...
...
@@ -1845,7 +1845,7 @@ parse_content_type (struct compose_env *env,
case
'('
:
if
(
comment
)
{
m
h
_error
(
_
(
"%s:%lu: comment redefined"
),
m
u
_error
(
_
(
"%s:%lu: comment redefined"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
status
=
1
;
...
...
@@ -1857,7 +1857,7 @@ parse_content_type (struct compose_env *env,
case
'['
:
if
(
!
descr
)
{
m
h
_error
(
_
(
"%s:%lu: syntax error"
),
m
u
_error
(
_
(
"%s:%lu: syntax error"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
status
=
1
;
...
...
@@ -1866,7 +1866,7 @@ parse_content_type (struct compose_env *env,
if
(
*
descr
)
{
m
h
_error
(
_
(
"%s:%lu: description redefined"
),
m
u
_error
(
_
(
"%s:%lu: description redefined"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
status
=
1
;
...
...
@@ -1878,7 +1878,7 @@ parse_content_type (struct compose_env *env,
case
'<'
:
if
(
*
id
)
{
m
h
_error
(
_
(
"%s:%lu: content id redefined"
),
m
u
_error
(
_
(
"%s:%lu: content id redefined"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
status
=
1
;
...
...
@@ -1897,7 +1897,7 @@ parse_content_type (struct compose_env *env,
skipws
(
rest
);
if
(
*
rest
!=
'='
)
{
m
h
_error
(
_
(
"%s:%lu: syntax error"
),
m
u
_error
(
_
(
"%s:%lu: syntax error"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
status
=
1
;
...
...
@@ -1960,7 +1960,7 @@ parse_type_command (char **pcmd, struct compose_env *env, mu_header_t hdr)
if
(
!
subtype
)
{
m
h
_error
(
_
(
"%s:%lu: missing subtype"
),
m
u
_error
(
_
(
"%s:%lu: missing subtype"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
return
1
;
...
...
@@ -2116,7 +2116,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
h
_error
(
_
(
"Cannot create header: %s"
),
m
u
_error
(
_
(
"Cannot create header: %s"
),
mu_strerror
(
rc
));
return
1
;
}
...
...
@@ -2175,7 +2175,7 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level)
case
'['
:
if
(
descr
)
{
m
h
_error
(
_
(
"%s:%lu: description redefined"
),
m
u
_error
(
_
(
"%s:%lu: description redefined"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
status
=
1
;
...
...
@@ -2187,7 +2187,7 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level)
case
'<'
:
if
(
id
)
{
m
h
_error
(
_
(
"%s:%lu: content id redefined"
),
m
u
_error
(
_
(
"%s:%lu: content id redefined"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
status
=
1
;
...
...
@@ -2208,7 +2208,7 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level)
if
(
mu_argcv_get
(
cmd
,
"
\n
"
,
NULL
,
&
argc
,
&
argv
))
{
m
h
_error
(
_
(
"%s:%lu: syntax error"
),
m
u
_error
(
_
(
"%s:%lu: syntax error"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
return
1
;
...
...
@@ -2222,7 +2222,7 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level)
mu_message_t
input_msg
;
if
(
mh_get_message
(
mbox
,
i
,
&
input_msg
)
==
0
)
{
m
h
_error
(
_
(
"%s:%lu: no such message: %lu"
),
m
u
_error
(
_
(
"%s:%lu: no such message: %lu"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
),
(
unsigned
long
)
i
);
...
...
@@ -2313,7 +2313,7 @@ edit_mime (char *cmd, struct compose_env *env, mu_message_t *msg, int level)
}
else
if
(
p
==
cmd
)
{
m
h
_error
(
_
(
"%s:%lu: missing filename"
),
m
u
_error
(
_
(
"%s:%lu: missing filename"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
finish_msg
(
env
,
msg
);
...
...
@@ -2324,14 +2324,14 @@ edit_mime (char *cmd, struct compose_env *env, mu_message_t *msg, int level)
rc
=
mu_file_stream_create
(
&
in
,
cmd
,
MU_STREAM_READ
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot create input stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot create input stream (file %s): %s"
),
cmd
,
mu_strerror
(
rc
));
return
rc
;
}
rc
=
mu_stream_open
(
in
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot open input stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot open input stream (file %s): %s"
),
cmd
,
mu_strerror
(
rc
));
mu_stream_destroy
(
&
in
,
mu_stream_get_owner
(
in
));
return
rc
;
...
...
@@ -2369,7 +2369,7 @@ edit_mime (char *cmd, struct compose_env *env, mu_message_t *msg, int level)
rc
=
mu_stream_open
(
fstr
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot open filter stream: %s"
),
m
u
_error
(
_
(
"Cannot open filter stream: %s"
),
mu_strerror
(
rc
));
return
rc
;
}
...
...
@@ -2505,7 +2505,7 @@ mhn_edit (struct compose_env *env, int level)
{
if
(
level
==
0
)
{
m
h
_error
(
_
(
"%s:%lu: unmatched #end"
),
m
u
_error
(
_
(
"%s:%lu: unmatched #end"
),
input_file
,
(
unsigned
long
)
mhn_error_loc
(
env
));
status
=
1
;
...
...
@@ -2718,7 +2718,7 @@ mhn_compose ()
rc
=
mu_file_stream_create
(
&
stream
,
name
,
MU_STREAM_RDWR
|
MU_STREAM_CREAT
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot create output stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot create output stream (file %s): %s"
),
name
,
mu_strerror
(
rc
));
free
(
name
);
return
rc
;
...
...
@@ -2726,7 +2726,7 @@ mhn_compose ()
rc
=
mu_stream_open
(
stream
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot open output stream (file %s): %s"
),
m
u
_error
(
_
(
"Cannot open output stream (file %s): %s"
),
name
,
mu_strerror
(
rc
));
free
(
name
);
mu_stream_destroy
(
&
stream
,
mu_stream_get_owner
(
stream
));
...
...
@@ -2773,7 +2773,7 @@ main (int argc, char **argv)
{
if
(
argc
)
{
m
h
_error
(
_
(
"extra arguments"
));
m
u
_error
(
_
(
"extra arguments"
));
return
1
;
}
message
=
mh_file_to_message
(
mu_folder_directory
(),
input_file
);
...
...
@@ -2784,7 +2784,7 @@ main (int argc, char **argv)
{
if
(
argc
>
1
)
{
m
h
_error
(
_
(
"extra arguments"
));
m
u
_error
(
_
(
"extra arguments"
));
return
1
;
}
input_file
=
argc
==
1
?
argv
[
0
]
:
"draft"
;
...
...
mh/pick.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005
, 2006
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
...
...
@@ -138,7 +138,7 @@ add_sequence (char *name)
{
if
(
!
seq_list
&&
mu_list_create
(
&
seq_list
))
{
m
h
_error
(
_
(
"Cannot create sequence list"
));
m
u
_error
(
_
(
"Cannot create sequence list"
));
exit
(
1
);
}
mu_list_append
(
seq_list
,
name
);
...
...
@@ -278,7 +278,7 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
{
if
(
state
->
next
==
state
->
argc
)
{
m
h
_error
(
_
(
"Invalid option -- %s"
),
s
);
m
u
_error
(
_
(
"Invalid option -- %s"
),
s
);
exit
(
1
);
}
p
=
state
->
argv
[
state
->
next
++
];
...
...
mh/pick.y
View file @
54e5182
%{
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005
, 2006
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
...
...
@@ -85,7 +85,7 @@ regex : cflags T_STRING
{
char errbuf[512];
regerror (rc, &$$, errbuf, sizeof (errbuf));
m
h
_error ("error compiling regex \"%s\": %s",
m
u
_error ("error compiling regex \"%s\": %s",
$2, errbuf);
YYERROR;
}
...
...
@@ -113,7 +113,7 @@ expr : lbrace exprlist rbrace
time_t t;
if (mu_parse_date ($2, &t, NULL))
{
m
h
_error (_("bad date format: %s"), $2);
m
u
_error (_("bad date format: %s"), $2);
exit (1);
}
$$ = pick_node_create (node_before, NULL, NULL);
...
...
@@ -124,7 +124,7 @@ expr : lbrace exprlist rbrace
time_t t;
if (mu_parse_date ($2, &t, NULL))
{
m
h
_error (_("bad date format: %s"), $2);
m
u
_error (_("bad date format: %s"), $2);
exit (1);
}
$$ = pick_node_create (node_after, NULL, NULL);
...
...
@@ -227,9 +227,9 @@ yyerror (char *s)
str = tokname (tok);
if (nesting_level)
m
h
_error (_("%s near %s (missing closing brace?)"), s, str);
m
u
_error (_("%s near %s (missing closing brace?)"), s, str);
else
m
h
_error (_("%s near %s"), s, str);
m
u
_error (_("%s near %s"), s, str);
return 0;
}
...
...
@@ -241,7 +241,7 @@ pick_add_token (mu_list_t *list, int tok, char *val)
if (!*list && (rc = mu_list_create (list)))
{
m
h
_error(_("cannot create list: %s"), mu_strerror (rc));
m
u
_error(_("cannot create list: %s"), mu_strerror (rc));
exit (1);
}
tp = xmalloc (sizeof (*tp));
...
...
@@ -430,7 +430,7 @@ set_cflags (char *str)
break;
default:
m
h
_error (_("Invalid regular expression flag: %c"), *str);
m
u
_error (_("Invalid regular expression flag: %c"), *str);
exit (1);
}
}
...
...
mh/refile.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002,
2003,2004,2005
Free Software Foundation, Inc.
Copyright (C) 2002,
2003, 2004, 2005, 2006
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
...
...
@@ -74,7 +74,7 @@ add_folder (const char *folder)
{
if
(
!
folder_name_list
&&
mu_list_create
(
&
folder_name_list
))
{
m
h
_error
(
_
(
"Cannot create folder list"
));
m
u
_error
(
_
(
"Cannot create folder list"
));
exit
(
1
);
}
mu_list_append
(
folder_name_list
,
strdup
(
folder
));
...
...
@@ -87,19 +87,19 @@ open_folders ()
if
(
!
folder_name_list
)
{
m
h
_error
(
_
(
"No folder specified"
));
m
u
_error
(
_
(
"No folder specified"
));
exit
(
1
);
}
if
(
mu_list_create
(
&
folder_mbox_list
))
{
m
h
_error
(
_
(
"Cannot create folder list"
));
m
u
_error
(
_
(
"Cannot create folder list"
));
exit
(
1
);
}
if
(
mu_list_get_iterator
(
folder_name_list
,
&
itr
))
{
m
h
_error
(
_
(
"Cannot create iterator"
));
m
u
_error
(
_
(
"Cannot create iterator"
));
exit
(
1
);
}
...
...
@@ -124,7 +124,7 @@ enumerate_folders (void (*f) (void *, mu_mailbox_t), void *data)
if
(
mu_list_get_iterator
(
folder_mbox_list
,
&
itr
))
{
m
h
_error
(
_
(
"Cannot create iterator"
));
m
u
_error
(
_
(
"Cannot create iterator"
));
exit
(
1
);
}
...
...
@@ -198,7 +198,7 @@ refile_folder (void *data, mu_mailbox_t mbox)
rc
=
mu_mailbox_append_message
(
mbox
,
msg
);
if
(
rc
)
{
m
h
_error
(
_
(
"Error appending message: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Error appending message: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
}
...
...
@@ -258,7 +258,7 @@ main (int argc, char **argv)
if
(
argc
>
0
)
{
m
h
_error
(
_
(
"Both message set and source file given"
));
m
u
_error
(
_
(
"Both message set and source file given"
));
exit
(
1
);
}
msg
=
mh_file_to_message
(
mu_folder_directory
(),
source_file
);
...
...
mh/repl.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002,
2003,2005
Free Software Foundation, Inc.
Copyright (C) 2002,
2003, 2005, 2006
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
...
...
@@ -130,7 +130,7 @@ decode_cc_flag (const char *opt, const char *arg)
int
rc
=
mh_decode_rcpt_flag
(
arg
);
if
(
rc
==
RCPT_NONE
)
{
m
h
_error
(
_
(
"%s %s is unknown"
),
opt
,
arg
);
m
u
_error
(
_
(
"%s %s is unknown"
),
opt
,
arg
);
exit
(
1
);
}
return
rc
;
...
...
@@ -302,7 +302,7 @@ make_draft (mu_mailbox_t mbox, int disp, struct mh_whatnow_env *wh)
rc
=
mu_mailbox_get_message
(
mbox
,
msgset
.
list
[
0
],
&
msg
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot read message %s: %s"
),
m
u
_error
(
_
(
"Cannot read message %s: %s"
),
mu_umaxtostr
(
0
,
msgset
.
list
[
0
]),
mu_strerror
(
rc
));
exit
(
1
);
...
...
@@ -323,14 +323,14 @@ make_draft (mu_mailbox_t mbox, int disp, struct mh_whatnow_env *wh)
MU_STREAM_WRITE
|
MU_STREAM_CREAT
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot create draft file stream %s: %s"
),
m
u
_error
(
_
(
"Cannot create draft file stream %s: %s"
),
wh
->
file
,
mu_strerror
(
rc
));
exit
(
1
);
}
if
((
rc
=
mu_stream_open
(
str
)))
{
m
h
_error
(
_
(
"Cannot open draft file %s: %s"
),
m
u
_error
(
_
(
"Cannot open draft file %s: %s"
),
wh
->
file
,
mu_strerror
(
rc
));
exit
(
1
);
}
...
...
@@ -385,7 +385,7 @@ main (int argc, char **argv)
opt_handler
,
NULL
,
&
index
);
if
(
mh_format_parse
(
format_str
,
&
format
))
{
m
h
_error
(
_
(
"Bad format string"
));
m
u
_error
(
_
(
"Bad format string"
));
exit
(
1
);
}
...
...
@@ -393,7 +393,7 @@ main (int argc, char **argv)
mh_msgset_parse
(
mbox
,
&
msgset
,
argc
-
index
,
argv
+
index
,
"cur"
);
if
(
msgset
.
count
!=
1
)
{
m
h
_error
(
_
(
"only one message at a time!"
));
m
u
_error
(
_
(
"only one message at a time!"
));
return
1
;
}
...
...
mh/rmf.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
Copyright (C) 2002, 2005
, 2006
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
...
...
@@ -125,7 +125,7 @@ rmf (const char *name)
if
(
!
dir
)
{
m
h
_error
(
_
(
"Cannot scan folder %s: %s"
),
name
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot scan folder %s: %s"
),
name
,
strerror
(
errno
));
return
1
;
}
...
...
@@ -144,7 +144,7 @@ rmf (const char *name)
asprintf
(
&
p
,
"%s/%s"
,
name
,
entry
->
d_name
);
if
(
stat
(
p
,
&
st
)
<
0
)
{
m
h
_error
(
_
(
"Cannot stat %s: %s"
),
p
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot stat %s: %s"
),
p
,
strerror
(
errno
));
}
else
if
(
S_ISDIR
(
st
.
st_mode
))
{
...
...
@@ -161,7 +161,7 @@ rmf (const char *name)
{
if
(
unlink
(
p
))
{
m
h
_error
(
_
(
"Cannot unlink %s: %s"
),
p
,
strerror
(
errno
));
m
u
_error
(
_
(
"Cannot unlink %s: %s"
),
p
,
strerror
(
errno
));
failures
++
;
}
}
...
...
mh/scan.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2005 Free Software Foundation, Inc.
2005
, 2006
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
...
...
@@ -186,7 +186,7 @@ main (int argc, char **argv)
if
(
mh_format_parse
(
format_str
,
&
format
))
{
m
h
_error
(
_
(
"Bad format string"
));
m
u
_error
(
_
(
"Bad format string"
));
exit
(
1
);
}
...
...
@@ -226,7 +226,7 @@ main (int argc, char **argv)
mu_url_t
url
=
NULL
;
mu_mailbox_get_url
(
mbox
,
&
url
);
m
h
_error
(
_
(
"no messages in %s"
),
mu_url_to_string
(
url
));
m
u
_error
(
_
(
"no messages in %s"
),
mu_url_to_string
(
url
));
}
clear_screen
();
...
...
mh/send.c
View file @
54e5182
...
...
@@ -265,7 +265,7 @@ check_file (char *name)
return
1
;
if
(
!
mesg_list
&&
mu_list_create
(
&
mesg_list
))
{
m
h
_error
(
_
(
"Cannot create message list"
));
m
u
_error
(
_
(
"Cannot create message list"
));
return
1
;
}
...
...
@@ -333,7 +333,7 @@ open_mailer ()
status
=
mu_mailer_create
(
&
mailer
,
url
);
if
(
status
)
{
m
h
_error
(
_
(
"Cannot create mailer `%s'"
),
url
);
m
u
_error
(
_
(
"Cannot create mailer `%s'"
),
url
);
return
NULL
;
}
...
...
@@ -348,7 +348,7 @@ open_mailer ()
status
=
mu_mailer_open
(
mailer
,
MU_STREAM_RDWR
);
if
(
status
)
{
m
h
_error
(
_
(
"Cannot open mailer `%s'"
),
url
);
m
u
_error
(
_
(
"Cannot open mailer `%s'"
),
url
);
return
NULL
;
}
return
mailer
;
...
...
@@ -503,7 +503,7 @@ _action_send (void *item, void *data)
rc
=
mu_mailer_send_message
(
mailer
,
msg
,
NULL
,
NULL
);
if
(
rc
)
{
m
h
_error
(
_
(
"Cannot send message: %s"
),
mu_strerror
(
rc
));
m
u
_error
(
_
(
"Cannot send message: %s"
),
mu_strerror
(
rc
));
return
1
;
}
...
...
@@ -531,7 +531,7 @@ send (int argc, char **argv)
if
(
background
&&
daemon
(
0
,
0
)
<
0
)
{
m
h
_error
(
_
(
"Cannot switch to background: %s"
),
mu_strerror
(
errno
));
m
u
_error
(
_
(
"Cannot switch to background: %s"
),
mu_strerror
(
errno
));
return
1
;
}
...
...
@@ -570,7 +570,7 @@ main (int argc, char **argv)
if
(
stat
(
xargv
[
0
],
&
st
))
{
m
h
_error
(
_
(
"cannot stat %s: %s"
),
xargv
[
0
],
mu_strerror
(
errno
));
m
u
_error
(
_
(
"cannot stat %s: %s"
),
xargv
[
0
],
mu_strerror
(
errno
));
return
1
;
}
...
...
mh/sortm.c
View file @
54e5182
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005
, 2006
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
...
...
@@ -216,7 +216,7 @@ addop (char *field, compfun comp)
if
(
!
oplist
&&
mu_list_create
(
&
oplist
))
{
m
h
_error
(
_
(
"can't create operation list"
));
m
u
_error
(
_
(
"can't create operation list"
));
exit
(
1
);
}
op
->
field
=
field
;
...
...
@@ -554,7 +554,7 @@ main (int argc, char **argv)
if
(
action
==
ACTION_LIST
&&
mh_format_parse
(
format_str
,
&
format
))
{
m
h
_error
(
_
(
"Bad format string"
));
m
u
_error
(
_
(
"Bad format string"
));
exit
(
1
);
}
...
...
Please
register
or
sign in
to post a comment