RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 27-Jan-2010 21:08:19 Branch: HEAD Handle: 2010012720081800 Modified files: rpm/rpmdb db3.c Log: - db3: fix: revert buggy change to increment _r->size for single keys. Summary: Revision Changes Path 1.149 +9 -11 rpm/rpmdb/db3.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/rpmdb/db3.c ============================================================================ $ cvs diff -u -r1.148 -r1.149 db3.c --- rpm/rpmdb/db3.c 26 Jan 2010 23:40:36 -0000 1.148 +++ rpm/rpmdb/db3.c 27 Jan 2010 20:08:18 -0000 1.149 @@ -1826,8 +1826,7 @@ if (he->c == 1) { _ube = _hton_ui(*_u); /* XXX network order integer keys */ /* XXX is it worth avoiding the realloc here? */ - if (loadDBT(_r, he->tag, &_ube, _ulen)) - _r->size++; + xx = loadDBT(_r, he->tag, &_ube, _ulen); break; } _r->flags = DB_DBT_MULTIPLE | DB_DBT_APPMALLOC; @@ -1854,8 +1853,7 @@ if (he->c == 1) { _ube = _hton_ul(*_u); /* XXX network order integer keys */ /* XXX is it worth avoiding the realloc here? */ - if (loadDBT(_r, he->tag, _u, _ulen)) - _r->size++; + xx = loadDBT(_r, he->tag, _u, _ulen); break; } _r->flags = DB_DBT_MULTIPLE | DB_DBT_APPMALLOC; @@ -1877,21 +1875,21 @@ case RPM_BIN_TYPE: s = he->p.ptr; ns = he->c; /* XXX is it worth avoiding the realloc here? */ - if (ns > 0 && loadDBT(_r, he->tag, s, ns)) - _r->size++; + if (ns > 0) /* No "" empty keys please. */ + xx = loadDBT(_r, he->tag, s, ns); break; - case RPM_I18NSTRING_TYPE: /* XXX never occurs */ + case RPM_I18NSTRING_TYPE: /* XXX never occurs */ case RPM_STRING_TYPE: s = he->p.str; ns = strlen(s); /* XXX is it worth avoiding the realloc here? */ - if (ns > 0 && loadDBT(_r, he->tag, s, ns)) - _r->size++; + if (ns > 0) /* No "" empty keys please. */ + xx = loadDBT(_r, he->tag, s, ns); break; case RPM_STRING_ARRAY_TYPE: if (he->c == 1) { s = he->p.argv[0]; ns = strlen(s); - if (ns > 0 && loadDBT(_r, he->tag, s, ns)) - _r->size++; + if (ns > 0) /* No "" empty keys please. */ + xx = loadDBT(_r, he->tag, s, ns); } else { static double e = 1.0e-4; size_t m = 0; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org