From aebe73549f54d70ea97482c11284dc43f509add0 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Wed, 16 Sep 2009 20:23:34 +0300 Subject: [PATCH] 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. --- src/package.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);