From 3bed5a8577c9a5175fd2d10b5a5c217cddc90406 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 14 Jun 2012 18:23:56 +0000 Subject: (return_files) use proper accessors in the RPMTAG_OLDFILENAMES case --- NEWS | 1 + URPM.xs | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 187b1fb..f37385d 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ - fix a very old segfault in unused code +- internal cleanups - reduce code size Version 4.2 - 13 June 2012 diff --git a/URPM.xs b/URPM.xs index f23664e..bf896b2 100644 --- a/URPM.xs +++ b/URPM.xs @@ -701,16 +701,15 @@ return_files(const Header header, int filter_mode) { int32_t *dirIndexes = td_dirIndexes.data; int is_oldfilenames = !baseNames || !dirNames || !dirIndexes; - char **list = NULL; if (is_oldfilenames) { if (!headerGet(header, RPMTAG_OLDFILENAMES, &td_list, HEADERGET_DEFAULT)) return; - list = td_list.data; + rpmtdInit(&td_list); } for(i = 0; i < rpmtdCount(&td_baseNames); i++) { - if (list) { - s = list[i]; + if (is_oldfilenames) { + s = rpmtdNextString(&td_list); len = strlen(s); } else { len = strlen(dirNames[dirIndexes[i]]); -- cgit v1.2.1