[zypp-commit] r8050 - in /trunk/sat-solver: src/repo_solv.c tools/repo_write.c
![](https://seccdn.libravatar.org/avatar/5b0432820302562e4bbc2cd15291724f.jpg?s=120&d=mm&r=g)
Author: mlschroe Date: Thu Dec 6 14:10:44 2007 New Revision: 8050 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8050&view=rev Log: - cleanup code a bit Modified: trunk/sat-solver/src/repo_solv.c trunk/sat-solver/tools/repo_write.c Modified: trunk/sat-solver/src/repo_solv.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo_solv.c?rev=8050&r1=8049&r2=8050&view=diff ============================================================================== --- trunk/sat-solver/src/repo_solv.c (original) +++ trunk/sat-solver/src/repo_solv.c Thu Dec 6 14:10:44 2007 @@ -132,26 +132,31 @@ if ((c & 128) == 0) { x = (x << 6) | (c & 63); - if (!relative || x != 0) + if (relative) { - if (relative) - { - x--; - x += old; - old = x; - } - if (x >= max) + if (x == 0 && c == 0x40) { - pool_debug(mypool, SAT_FATAL, "read_idarray: id too large (%u/%u)\n", x, max); - exit(1); + /* prereq hack */ + if (store == end) + { + pool_debug(mypool, SAT_FATAL, "read_idarray: array overflow\n"); + exit(1); + } + *store++ = SOLVABLE_PREREQMARKER; + old = 0; + x = 0; + continue; } - if (map) - x = map[x]; + x = (x - 1) + old; + old = x; + } + if (x >= max) + { + pool_debug(mypool, SAT_FATAL, "read_idarray: id too large (%u/%u)\n", x, max); + exit(1); } - else - /* (relative && x==0) : - Ugly PREREQ handling. See repo_write.c. */ - x = SOLVABLE_PREREQMARKER, old = 0; + if (map) + x = map[x]; if (store == end) { pool_debug(mypool, SAT_FATAL, "read_idarray: array overflow\n"); @@ -160,6 +165,8 @@ *store++ = x; if ((c & 64) == 0) { + if (x == 0) /* already have trailing zero? */ + return store; if (store == end) { pool_debug(mypool, SAT_FATAL, "read_idarray: array overflow\n"); Modified: trunk/sat-solver/tools/repo_write.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_write.c?rev=8050&r1=8049&r2=8050&view=diff ============================================================================== --- trunk/sat-solver/tools/repo_write.c (original) +++ trunk/sat-solver/tools/repo_write.c Thu Dec 6 14:10:44 2007 @@ -198,8 +198,6 @@ return; if (!*ids) { - /* XXX I think this is broken. A lone '0' will be interpreted as - zero plus end-of-array, which stores another zero. */ write_u8(fp, 0); return; } @@ -235,8 +233,6 @@ return; if (!*ids) { - /* XXX I think this is broken. A lone '0' will be interpreted as - zero plus end-of-array, which stores another zero. */ write_u8 (fp, 0); return; } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlschroe@svn.opensuse.org