diff options
Diffstat (limited to 'libopkg/pkg_hash.c')
-rw-r--r-- | libopkg/pkg_hash.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c index 2a76be8..3e4d9d4 100644 --- a/libopkg/pkg_hash.c +++ b/libopkg/pkg_hash.c @@ -23,6 +23,7 @@ #include "opkg_message.h" #include "pkg_vec.h" #include "pkg_hash.h" +#include "parse_util.h" #include "pkg_parse.h" #include "opkg_utils.h" #include "sprintf_alloc.h" @@ -119,8 +120,12 @@ pkg_hash_add_from_file(const char *file_name, pkg->src = src; pkg->dest = dest; - ret = pkg_parse_from_stream_nomalloc(pkg, fp, 0, + ret = parse_from_stream_nomalloc(pkg, fp, 0, &buf, len); + if (pkg->name == NULL) { + /* probably just a blank line */ + ret = 1; + } if (ret) { pkg_deinit (pkg); free(pkg); |