diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2002-03-27 00:07:53 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2002-03-27 00:07:53 +0000 |
commit | a90a14eb4807fd3a22e7af24b5f00fc6f253ec9d (patch) | |
tree | f390e9f8f98b1ef9715b72564b632770ac1d2599 /charset.c | |
parent | b70f7ad43aa3281e7142c3a294e959015a6de0a8 (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.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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; |