aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-09-16 20:23:34 +0300
committerTimo Teras <timo.teras@iki.fi>2009-09-16 20:23:34 +0300
commitaebe73549f54d70ea97482c11284dc43f509add0 (patch)
tree03dbe2027c4a5f4433ccb0abf1b18baf7f16a640
parentd3861d70a88c6d2d3583fb90946aedb48a8d3e46 (diff)
downloadapk-tools-aebe73549f54d70ea97482c11284dc43f509add0.tar.gz
apk-tools-aebe73549f54d70ea97482c11284dc43f509add0.tar.bz2
apk-tools-aebe73549f54d70ea97482c11284dc43f509add0.tar.xz
pkg: fix parsing of empty dependencies
if the dependencies are empty with only trailing new line, the parsing was incorrect. fix the new line check.
-rw-r--r--src/package.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/package.c b/src/package.c
index 9e74854..ee3f40e 100644
--- a/src/package.c
+++ b/src/package.c
@@ -275,7 +275,7 @@ void apk_deps_parse(struct apk_database *db,
{
struct parse_depend_ctx ctx = { db, depends };
- if (blob.len > 1 && blob.ptr[blob.len-1] == '\n')
+ if (blob.len > 0 && blob.ptr[blob.len-1] == '\n')
blob.len--;
apk_blob_for_each_segment(blob, " ", parse_depend, &ctx);