From 65f241a081ff7573f6cda27927ad483cef6f4e25 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 22 Jan 2010 23:54:33 +0100 Subject: [PATCH] xbps_repository_get_pkg_plist_dict_from_url: stop processing the archive once that 4 entries are checked for the plist file. Processing 6 entries is too much, we can be sure that plist file will always be in the first 4 entries. --HG-- extra : convert_revision : xtraeme%40gmail.com-20100122225433-u440x01bf8io3vd3 --- lib/repository_plist.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/repository_plist.c b/lib/repository_plist.c index 05b9d028..d4375e49 100644 --- a/lib/repository_plist.c +++ b/lib/repository_plist.c @@ -194,16 +194,16 @@ xbps_repository_get_pkg_plist_dict_from_url(const char *url, const char *plistf) while ((archive_read_next_header(a, &entry)) == ARCHIVE_OK) { curpath = archive_entry_pathname(entry); - if (i >= 5) { - /* - * Archive does not contain required plist - * file, discard it completely. - */ - errno = ENOENT; - break; - } if (strstr(curpath, plistf) == 0) { archive_read_data_skip(a); + if (i >= 3) { + /* + * Archive does not contain required + * plist file, discard it completely. + */ + errno = ENOENT; + break; + } i++; continue; }