index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-06-03 14:37:51 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-03 14:37:51 -0500 |
commit | cc25576f8b54b3e975949ac7991a193053b519bc (patch) | |
tree | 546febcbf96be529f4326b526841ca4c2ec8c9de /lib/libalpm/be_package.c | |
parent | e68f5d9a30671419c853b255b32b2e9d0239c9f1 (diff) |
-rw-r--r-- | lib/libalpm/be_package.c | 10 |
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index c70d1e9a..c89365a2 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -137,13 +137,13 @@ static struct pkg_operations *get_file_pkg_ops(void) * @param archive the archive to read from, pointed at the .PKGINFO entry * @param newpkg an empty pmpkg_t struct to fill with package info * - * @return 0 on success, 1 on error + * @return 0 on success, -1 on error */ static int parse_descfile(struct archive *a, pmpkg_t *newpkg) { char *ptr = NULL; char *key = NULL; - int linenum = 0; + int ret, linenum = 0; struct archive_read_buffer buf; memset(&buf, 0, sizeof(buf)); @@ -151,7 +151,7 @@ static int parse_descfile(struct archive *a, pmpkg_t *newpkg) buf.max_line_size = 512 * 1024; /* loop until we reach EOF or other error */ - while(_alpm_archive_fgets(a, &buf) == ARCHIVE_OK) { + while((ret = _alpm_archive_fgets(a, &buf)) == ARCHIVE_OK) { char *line = _alpm_strtrim(buf.line); linenum++; @@ -215,6 +215,10 @@ static int parse_descfile(struct archive *a, pmpkg_t *newpkg) } line[0] = '\0'; } + if(ret != ARCHIVE_EOF) { + _alpm_log(PM_LOG_DEBUG, "error parsing package descfile\n"); + return -1; + } return 0; } |