From c5e7eeece75e2774d304116bc5003371cc8f1e8e Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 12 Jul 2012 14:50:56 -0400 Subject: lib/be_local: ensure local filelists are sorted This may very well be a no-op, but better safe than sorry. Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- lib/libalpm/be_local.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libalpm') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index ee805b9e..a8c8468b 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -688,6 +688,8 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) } /* attempt to hand back any memory we don't need */ files = realloc(files, sizeof(alpm_file_t) * files_count); + /* make sure the list is sorted */ + qsort(files, files_count, sizeof(alpm_file_t), _alpm_files_cmp); info->files.count = files_count; info->files.files = files; } else if(strcmp(line, "%BACKUP%") == 0) { -- cgit v1.2.3-70-g09d2