[Rpm-maint] [rpm-software-management/rpm] rpmuncompress: Support -C for zip and 7zip archives (PR #3263)

Panu Matilainen notifications at github.com
Fri Aug 30 08:16:11 UTC 2024


@pmatilai commented on this pull request.



>  	/* Do all entries in the archive start with the same lead directory? */
 	rootLen = sep - rootName + 1;
 	while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
 	    const char *p = archive_entry_pathname(entry);
 	    if (strncmp(rootName, p, rootLen)) {
-		ret = 0;
+		rootName = _free(rootName);

Multiple ways to achieve that of course, if you don't like the integer ret, have another pointer that defaults to NULL and only gets set otherwise when single root is detected (ie "assume failure" pattern), that way you can drop the assignments preceding the gotos too.

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

Message ID: <rpm-software-management/rpm/pull/3263/review/2271540111 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240830/8aa37102/attachment-0001.html>


More information about the Rpm-maint mailing list