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
30cc8131
...
30cc813126415a4a40e812b2bd6c63f46d095384
authored
2007-07-09 17:41:24 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Rewrite using new envelope accessors
1 parent
c8bb4b94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
23 deletions
readmsg/readmsg.c
readmsg/readmsg.c
View file @
30cc813
...
...
@@ -136,41 +136,26 @@ string_starts_with (const char * s1, const char *s2)
static
void
print_unix_header
(
mu_message_t
message
)
{
static
size_t
bufsize
;
static
char
*
buf
;
const
char
*
buf
;
size_t
size
;
mu_envelope_t
envelope
=
NULL
;
mu_message_get_envelope
(
message
,
&
envelope
);
if
(
mu_envelope_sender
(
envelope
,
NULL
,
0
,
&
size
)
||
size
==
0
)
return
;
if
(
size
>
bufsize
)
{
bufsize
=
size
+
1
;
buf
=
xrealloc
(
buf
,
bufsize
);
}
mu_envelope_sender
(
envelope
,
buf
,
bufsize
,
0
);
if
(
mu_envelope_sget_sender
(
envelope
,
&
buf
))
buf
=
"UNKNOWN"
;
printf
(
"From %s "
,
buf
);
if
(
mu_envelope_date
(
envelope
,
NULL
,
0
,
&
size
)
==
0
&&
size
>
0
)
{
if
(
size
>
bufsize
)
{
bufsize
=
size
+
1
;
buf
=
xrealloc
(
buf
,
bufsize
);
}
mu_envelope_date
(
envelope
,
buf
,
bufsize
,
NULL
);
}
else
{
if
(
mu_envelope_sget_date
(
envelope
,
&
buf
))
{
char
datebuf
[
MU_ENVELOPE_DATE_LENGTH
+
1
];
time_t
t
;
struct
tm
*
tm
;
t
=
time
(
NULL
);
tm
=
localtime
(
&
t
);
mu_strftime
(
buf
,
bufsize
,
"%a %b %d %H:%M:%S %Y"
,
tm
);
mu_strftime
(
datebuf
,
sizeof
datebuf
,
"%a %b %d %H:%M:%S %Y"
,
tm
);
buf
=
datebuf
;
}
printf
(
"%s"
,
buf
);
...
...
Please
register
or
sign in
to post a comment