author | zautrix <zautrix> | 2005-01-24 12:16:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-24 12:16:16 (UTC) |
commit | d4f5ce1bedd03191da5ecef2dc68381c10ef1fba (patch) (side-by-side diff) | |
tree | 2d6860078083e588f8f365b308ee4ffb2c34f1c1 /kmicromail/libetpan | |
parent | 485a6b28e3be6437742852970fdd122ba071b726 (diff) | |
download | kdepimpi-d4f5ce1bedd03191da5ecef2dc68381c10ef1fba.zip kdepimpi-d4f5ce1bedd03191da5ecef2dc68381c10ef1fba.tar.gz kdepimpi-d4f5ce1bedd03191da5ecef2dc68381c10ef1fba.tar.bz2 |
more imap fixes
-rw-r--r-- | kmicromail/libetpan/imap/mailimap_parser.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/kmicromail/libetpan/imap/mailimap_parser.c b/kmicromail/libetpan/imap/mailimap_parser.c index 1c2ecde..560e58a 100644 --- a/kmicromail/libetpan/imap/mailimap_parser.c +++ b/kmicromail/libetpan/imap/mailimap_parser.c @@ -2370,66 +2370,84 @@ mailimap_body_fld_known_enc_parse(mailstream * fd, MMAPString * buffer, err: return res; } static int mailimap_body_fld_enc_parse(mailstream * fd, MMAPString * buffer, size_t * index, struct mailimap_body_fld_enc ** result, size_t progr_rate, progress_function * progr_fun) { size_t cur_token; int type; char * value; struct mailimap_body_fld_enc * body_fld_enc; int r; int res; cur_token = * index; r = mailimap_body_fld_known_enc_parse(fd, buffer, &cur_token, &type, progr_rate, progr_fun); if (r == MAILIMAP_NO_ERROR) { value = NULL; } else if (r == MAILIMAP_ERROR_PARSE) { type = MAILIMAP_BODY_FLD_ENC_OTHER; r = mailimap_string_parse(fd, buffer, &cur_token, &value, NULL, progr_rate, progr_fun); if (r != MAILIMAP_NO_ERROR) { - res = r; - goto err; + // LR start + // accept NIL and set type to utf8 + int ret = r; + r = mailimap_char_parse(fd, buffer, &cur_token, 'N'); + if (r == MAILIMAP_NO_ERROR) { + r = mailimap_char_parse(fd, buffer, &cur_token, 'I'); + if (r == MAILIMAP_NO_ERROR) { + r = mailimap_char_parse(fd, buffer, &cur_token, 'L'); + if (r == MAILIMAP_NO_ERROR) { + type = 4; + ret = MAILIMAP_NO_ERROR; + value = NULL; + } + } + } + if ( ret != MAILIMAP_NO_ERROR ) { + res = ret; + goto err; + } + // LR end } } else { res = r; goto err; } body_fld_enc = mailimap_body_fld_enc_new(type, value); if (body_fld_enc == NULL) { res = MAILIMAP_ERROR_MEMORY; goto value_free; } * result = body_fld_enc; * index = cur_token; return MAILIMAP_NO_ERROR; value_free: if (value) mailimap_string_free(value); err: return res; } /* body-fld-id = nstring */ static int mailimap_body_fld_id_parse(mailstream * fd, MMAPString * buffer, size_t * index, char ** result, size_t progr_rate, |