From: Michael Schroeder Date: Fri, 11 Dec 2015 11:08:36 +0000 (+0100) Subject: Move setting of data->incoreoffset[entry] X-Git-Tag: 0.6.15~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e674e4ba7c2dbd6ce40d73b7c57c2bee3bc50edf;p=thirdparty%2Flibsolv.git Move setting of data->incoreoffset[entry] We need the old value when we copy the complete old entry --- diff --git a/src/repodata.c b/src/repodata.c index c005b7a8..ad3e71a2 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -3411,19 +3411,19 @@ fprintf(stderr, "schemadata %p\n", data->schemadata); } } - /* Now create data blob. We walk through the (possibly new) schema - and either copy over old data, or insert the new. */ - if (entry >= 0) - data->incoreoffset[entry] = newincore.len; - + /* just copy over the complete old entry (including the schemaid) if there was no new data */ if (entry >= 0 && !neednewschema && oldschemaid && (!data->attrs || !data->attrs[entry]) && dp) { - /* just copy over the complete old entry (including the schemaid) */ ndp = data->incoredata + data->incoreoffset[entry]; + data->incoreoffset[entry] = newincore.len; data_addblob(&newincore, ndp, dp - ndp); goto entrydone; } + /* Now create data blob. We walk through the (possibly new) schema + and either copy over old data, or insert the new. */ + if (entry >= 0) + data->incoreoffset[entry] = newincore.len; data_addid(&newincore, schemaid); /* we don't use a pointer to the schemadata here as repodata_serialize_key