@pmatilai commented on this pull request.


>      if (rpmGlob(attrPath, NULL, &files) == 0) {
-       nattrs = argvCount(files);
-       fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes));
-       for (int i = 0; i < nattrs; i++) {
-           char *bn = basename(files[i]);
-           bn[strlen(bn)-strlen(".attr")] = '\0';
-           fc->atypes[i] = rpmfcAttrNew(bn);
-       }
-       fc->atypes[nattrs] = NULL;
-       argvFree(files);
+       nfiles = argvCount(files);
+    }
+    for (int i = 0; i < nfiles; i++) {
+       char *bn = basename(files[i]);
+       bn[strlen(bn)-strlen(".attr")] = '\0';
+       argvAddUniq(&all_attrs, bn);

I realised the really right way to do this is to refactor the discovery/init 
split to a separate commit, and then the local_attr thing doesn't need to 
change anything at all, only add itself.
Having asked this to be one commit already I couldn't very well ask you to do 
this, so here goes: https://github.com/rpm-software-management/rpm/pull/2911

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2734#discussion_r1490545272
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2734/review/1881997...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to