aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-14 18:23:56 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-14 18:23:56 +0000
commit3bed5a8577c9a5175fd2d10b5a5c217cddc90406 (patch)
tree7916ea9d4f7b18bfbc2c8c17503f19ad67466ad8
parent8415bd7e2e880231a78efecd1693e41d889960df (diff)
downloadperl-URPM-3bed5a8577c9a5175fd2d10b5a5c217cddc90406.tar
perl-URPM-3bed5a8577c9a5175fd2d10b5a5c217cddc90406.tar.gz
perl-URPM-3bed5a8577c9a5175fd2d10b5a5c217cddc90406.tar.bz2
perl-URPM-3bed5a8577c9a5175fd2d10b5a5c217cddc90406.tar.xz
perl-URPM-3bed5a8577c9a5175fd2d10b5a5c217cddc90406.zip
(return_files) use proper accessors in the RPMTAG_OLDFILENAMES case
-rw-r--r--NEWS1
-rw-r--r--URPM.xs7
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]]);