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
1dc5c3b2
...
1dc5c3b255cf2ba5f97b5984d7f8480497a37d06
authored
2004-06-06 13:32:04 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Updated call to filter_iconv_create()
1 parent
c563f0a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
examples/iconv.c
mailbox/rfc2047.c
examples/iconv.c
View file @
1dc5c3b
...
...
@@ -42,7 +42,7 @@ main (int argc, char **argv)
rc
=
stdio_stream_create
(
&
in
,
stdin
,
0
);
assert
(
rc
==
0
);
assert
(
stream_open
(
in
)
==
0
);
assert
(
filter_iconv_create
(
&
cvt
,
in
,
argv
[
1
],
argv
[
2
],
0
)
==
0
);
assert
(
filter_iconv_create
(
&
cvt
,
in
,
argv
[
1
],
argv
[
2
],
0
,
mu_fallback_none
)
==
0
);
assert
(
stream_open
(
cvt
)
==
0
);
rc
=
stdio_stream_create
(
&
out
,
stdout
,
0
);
...
...
mailbox/rfc2047.c
View file @
1dc5c3b
...
...
@@ -27,6 +27,8 @@
#include <mailutils/filter.h>
#include <mailutils/errno.h>
enum
mu_iconv_fallback_mode
rfc2047_fallback_mode
=
mu_fallback_copy_octal
;
int
rfc2047_decode
(
const
char
*
tocode
,
const
char
*
input
,
char
**
ptostr
)
{
...
...
@@ -121,14 +123,30 @@ rfc2047_decode (const char *tocode, const char *input, char **ptostr)
if
(
status
!=
0
)
break
;
status
=
filter_iconv_create
(
&
cvt
,
filter
,
fromcode
,
tocode
,
0
);
status
=
filter_iconv_create
(
&
cvt
,
filter
,
fromcode
,
tocode
,
MU_STREAM_NO_CLOSE
,
rfc2047_fallback_mode
);
if
(
status
)
{
cvt
=
filter
;
/* Note: the filter stream is already open! */
}
else
{
if
(
stream_open
(
cvt
))
{
stream_destroy
(
cvt
,
stream_get_owner
(
cvt
));
stream_destroy
(
&
cvt
,
stream_get_owner
(
cvt
));
cvt
=
filter
;
}
else
{
int
flags
;
stream_get_flags
(
cvt
,
&
flags
);
flags
&=
~
MU_STREAM_NO_CLOSE
;
stream_set_flags
(
cvt
,
flags
);
}
}
while
(
stream_sequential_read
(
cvt
,
buffer
+
bufpos
,
bufsize
-
bufpos
,
&
nbytes
)
==
0
&&
nbytes
)
...
...
Please
register
or
sign in
to post a comment