summaryrefslogtreecommitdiffstats
path: root/charset.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2002-03-27 00:07:53 +0000
committerThomas Roessler <roessler@does-not-exist.org>2002-03-27 00:07:53 +0000
commita90a14eb4807fd3a22e7af24b5f00fc6f253ec9d (patch)
treef390e9f8f98b1ef9715b72564b632770ac1d2599 /charset.c
parentb70f7ad43aa3281e7142c3a294e959015a6de0a8 (diff)
Some hackisch charset handling for text/plain; x-action=pgp-*. I
don't like this stuff, but it's better than nothing.
Diffstat (limited to 'charset.c')
-rw-r--r--charset.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/charset.c b/charset.c
index 228c6bda..38b6edbd 100644
--- a/charset.c
+++ b/charset.c
@@ -495,6 +495,27 @@ FGETCONV *fgetconv_open (FILE *file, const char *from, const char *to, int flags
return (FGETCONV *)fc;
}
+char *fgetconvs (char *buf, size_t l, FGETCONV *_fc)
+{
+ int c;
+ size_t r;
+
+ for (r = 0; r + 1 < l;)
+ {
+ if ((c = fgetconv (_fc)) == EOF)
+ break;
+ buf[r++] = (char) c;
+ if (c == '\n')
+ break;
+ }
+ buf[r] = '\0';
+
+ if (r)
+ return buf;
+ else
+ return NULL;
+}
+
int fgetconv (FGETCONV *_fc)
{
struct fgetconv_s *fc = (struct fgetconv_s *)_fc;