aboutsummaryrefslogtreecommitdiffstats
path: root/istream.c
diff options
context:
space:
mode:
authorAkinori Ito <aito@eie.yz.yamagata-u.ac.jp>2001-11-09 04:59:17 +0000
committerAkinori Ito <aito@eie.yz.yamagata-u.ac.jp>2001-11-09 04:59:17 +0000
commit6c63633545c254dc085402e0f927a6826d1dd229 (patch)
tree0126fb5598304c713ea1276e294da9098b5df3b4 /istream.c
parentInitial revision (diff)
downloadw3m-6c63633545c254dc085402e0f927a6826d1dd229.tar.gz
w3m-6c63633545c254dc085402e0f927a6826d1dd229.zip
Updates from 0.2.1 into 0.2.1-inu-1.5release-0-2-1-inu-1-5
Diffstat (limited to '')
-rw-r--r--istream.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/istream.c b/istream.c
index 27b8d47..401f9ef 100644
--- a/istream.c
+++ b/istream.c
@@ -1,7 +1,10 @@
-/* $Id: istream.c,v 1.1 2001/11/08 05:15:57 a-ito Exp $ */
+/* $Id: istream.c,v 1.2 2001/11/09 04:59:17 a-ito Exp $ */
#include "fm.h"
#include "istream.h"
#include <signal.h>
+#ifdef __EMX__
+#include <strings.h> /* for bzero() */
+#endif /* __EMX__ */
#define uchar unsigned char
@@ -156,7 +159,8 @@ InputStream
newEncodedStream(InputStream is, char encoding)
{
InputStream stream;
- if (is == NULL || (encoding != ENC_QUOTE && encoding != ENC_BASE64))
+ if (is == NULL || (encoding != ENC_QUOTE && encoding != ENC_BASE64 &&
+ encoding != ENC_UUENCODE))
return is;
stream = New(union input_stream);
init_base_stream(&stream->base, STREAM_BUF_SIZE);
@@ -464,11 +468,18 @@ ens_read(struct ens_handle *handle, char *buf, int len)
cleanup_line(handle->s, PAGER_MODE);
if (handle->encoding == ENC_BASE64)
Strchop(handle->s);
+ else if (handle->encoding == ENC_UUENCODE) {
+ if (! strncmp(handle->s->ptr, "begin", 5))
+ handle->s = StrmyISgets(handle->is);
+ Strchop(handle->s);
+ }
p = handle->s->ptr;
if (handle->encoding == ENC_QUOTE)
handle->s = decodeQP(&p);
else if (handle->encoding == ENC_BASE64)
handle->s = decodeB(&p);
+ else if (handle->encoding == ENC_UUENCODE)
+ handle->s = decodeU(&p);
handle->pos = 0;
}