From eea1e59abbbc3e8d26c454d13a9fb59d88e652e2 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 17 Jan 2002 19:21:11 +0000 Subject: Stop uudecoding once the CAMEL_UUDECODE_STATE_END state bit gets set. Set 2002-01-17 Jeffrey Stedfast * camel-mime-filter-basic.c (filter): Stop uudecoding once the CAMEL_UUDECODE_STATE_END state bit gets set. Set the CAMEL_UUDECODE_STATE_BEGIN state bit once we find the begin line. (reset): No longer have uu_begin or uulen state variables, these are now stuffed into a single state variable. * camel-mime-utils.c (uudecode_step): No longer needs a uulen argument and also keeps track of whether or not the end of the encoded data has been found in 'state'. (uuencode_step): Now stuffs uulen into state so that the uulen argument is no longer needed. (uuencode_close): Same. svn path=/trunk/; revision=15349 --- camel/camel-mime-utils.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'camel/camel-mime-utils.h') diff --git a/camel/camel-mime-utils.h b/camel/camel-mime-utils.h index fcd1a06fa5..8bd9c81993 100644 --- a/camel/camel-mime-utils.h +++ b/camel/camel-mime-utils.h @@ -28,6 +28,11 @@ /* maximum size of a line from header_fold() */ #define CAMEL_FOLD_SIZE (77) +#define CAMEL_UUDECODE_STATE_INIT (0) +#define CAMEL_UUDECODE_STATE_BEGIN (1 << 16) +#define CAMEL_UUDECODE_STATE_END (1 << 17) +#define CAMEL_UUDECODE_STATE_MASK (CAMEL_UUDECODE_STATE_BEGIN | CAMEL_UUDECODE_STATE_END) + /* a list of references for this message */ struct _header_references { struct _header_references *next; @@ -191,12 +196,12 @@ size_t base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int size_t base64_encode_step(unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save); size_t base64_encode_close(unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save); -size_t uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *state, guint32 *save, char *uulen); +size_t uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *state, guint32 *save); size_t uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state, - guint32 *save, char *uulen); + guint32 *save); size_t uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char *uubuf, int *state, - guint32 *save, char *uulen); + guint32 *save); size_t quoted_decode_step(unsigned char *in, size_t len, unsigned char *out, int *savestate, int *saveme); -- cgit v1.2.3