commit 0572e66f53861c5627b571aabe90b676d4c24740
Author: Michael Andres
Date: Tue Jan 20 16:39:23 2009 +0100
Fix conversion to UTF8
---
tools/repo_rpmdb.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/tools/repo_rpmdb.c b/tools/repo_rpmdb.c
index 2b077fc..04bb2bc 100644
--- a/tools/repo_rpmdb.c
+++ b/tools/repo_rpmdb.c
@@ -7,9 +7,9 @@
/*
* repo_rpmdb
- *
+ *
* convert rpm db to repo
- *
+ *
*/
#include
@@ -158,12 +158,12 @@ headint32(RpmHead *h, int tag)
unsigned int i, o;
unsigned char *d, taga[4];
- d = h->dp - 16;
- taga[0] = tag >> 24;
- taga[1] = tag >> 16;
+ d = h->dp - 16;
+ taga[0] = tag >> 24;
+ taga[1] = tag >> 16;
taga[2] = tag >> 8;
taga[3] = tag;
- for (i = 0; i < h->cnt; i++, d -= 16)
+ for (i = 0; i < h->cnt; i++, d -= 16)
if (d[3] == taga[3] && d[2] == taga[2] && d[1] == taga[1] && d[0] == taga[0])
break;
if (i >= h->cnt)
@@ -348,10 +348,8 @@ setutf8string(Repodata *repodata, Id handle, Id tag, const char *str)
c = (c & 0x0f) | 0xbff00000; /* 2 */
else if (c >= 0xc2)
c = (c & 0x1f) | 0xfc000000; /* 1 */
- else if (c >= 0xc0)
- c = 0xfdffffff; /* overlong */
else if (c >= 0x80)
- c = 0xfffd;
+ break;
}
state = (c & 0x80000000) ? c : 0;
}
@@ -1224,7 +1222,7 @@ count_headers(const char *rootdir, DB_ENV *dbenv)
/*
* read rpm db as repo
- *
+ *
*/
void
@@ -1256,19 +1254,19 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags)
Repodata *data;
int count = 0, done = 0;
unsigned int now;
-
+
now = sat_timems(0);
memset(&dbkey, 0, sizeof(dbkey));
memset(&dbdata, 0, sizeof(dbdata));
if (!rootdir)
rootdir = "";
-
+
if (!(flags & REPO_REUSE_REPODATA))
data = repo_add_repodata(repo, 0);
else
data = repo_last_repodata(repo);
-
+
if (ref && !(ref->nsolvables && ref->rpmdbid))
ref = 0;
@@ -1496,7 +1494,7 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags)
h = (h + 317) & refmask;
refhash[h] = i + 1; /* make it non-zero */
}
-
+
/* count the misses, they will cost us time */
if ((flags & RPMDB_REPORT_PROGRESS) != 0)
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org