X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mx%2Fhcache.c;h=de0e3e04a53d53514f9b3d3c69b9cc6ff6490c2a;hp=01db5bdd955058ce44677f280228ebf6a08ce43a;hb=refs%2Fheads%2Ftry-some-d;hpb=ba96e8b86330fb28f25aae2059b732cd64254015 diff --git a/lib-mx/hcache.c b/lib-mx/hcache.c index 01db5bd..de0e3e0 100644 --- a/lib-mx/hcache.c +++ b/lib-mx/hcache.c @@ -187,8 +187,9 @@ static const void *restore_list(const char *d, string_list_t **l) return d; } -static void dump_parameter(buffer_t *buf, parameter_t *p) +static void dump_parameter(buffer_t *buf, parameters_t *p) { +#if 0 int pos = buf->len, counter = 0; dump_int(buf, counter); @@ -199,22 +200,24 @@ static void dump_parameter(buffer_t *buf, parameter_t *p) } memcpy(buf->data + pos, &counter, sizeof(counter)); +#endif } -static const void *restore_parameter(const char *d, parameter_t ** p) +static const void *restore_parameter(const char *d, parameters_t *p) { int counter; d = restore_int(d, &counter); for (; counter > 0; counter--) { - *p = parameter_new(); - d = restore_cstr(d, &(*p)->attribute); - d = restore_cstr(d, &(*p)->value); - p = &(*p)->next; + char *k, *v; + d = restore_cstr(d, &k); + d = restore_cstr(d, &v); + parameter_setval(p, k, v); + p_delete(&k); + p_delete(&v); } - *p = NULL; return d; } @@ -240,7 +243,7 @@ static const void *restore_body(const char *d, BODY *c) d = restore_cstr(d, &c->xtype); d = restore_cstr(d, &c->subtype); - d = restore_parameter(d, &c->parameter); + d = restore_parameter(d, c->parameter); d = restore_cstr(d, &c->description); d = restore_cstr(d, &c->form_name); @@ -341,6 +344,7 @@ HEADER *mutt_hcache_restore(const void *_d, HEADER **oh) d = restore_envelope(d, h->env); h->content = body_new(); + h->content->parameter = parameter_new(); d = restore_body(d, h->content); d = restore_cstr(d, &h->maildir_flags);