Skip to content

Commit

Permalink
Fix up rpmuncompress not being compiled as C++
Browse files Browse the repository at this point in the history
This one lone source got overlooked in the initial C++ enablement
in commit 37cdcc2. C++ doesn't like
jumping over variable declarations, so just move the declarations
early to minimally fix the build.

Nicely goes to show the danger of such hacks - you can always miss
something. On the library side things are likely to blow up in
linkage but you never know really.
  • Loading branch information
pmatilai committed Oct 3, 2024
1 parent 332edb7 commit 17e15ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ endif()
set (cxx_sources
cliutils.c elfdeps.c rpm2archive.c rpmbuild.c rpm.c rpmdb.c
rpmdeps.c rpmdump.c rpmgraph.c rpmkeys.c rpmlua.c rpmsign.c
rpmsort.c rpmspec.c
rpmsort.c rpmspec.c rpmuncompress.c
)
set_source_files_properties(${cxx_sources} PROPERTIES LANGUAGE CXX)

Expand Down
6 changes: 4 additions & 2 deletions tools/rpmuncompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static char * singleRoot(const char *path)
struct archive_entry *entry;
int r, ret = -1, rootLen;
char *rootName = NULL;
char *sep = NULL;

a = archive_read_new();
archive_read_support_filter_all(a);
Expand All @@ -113,7 +114,7 @@ static char * singleRoot(const char *path)
goto afree;
}
rootName = xstrdup(archive_entry_pathname(entry));
char *sep = strchr(rootName, '/');
sep = strchr(rootName, '/');
if (sep == NULL) {
/* No directories in the pathname */
ret = 0;
Expand Down Expand Up @@ -151,11 +152,12 @@ static char *doUntar(const char *fn)
const char *taropts = verbose ? "-xvvof" : "-xof";
char *mkdir = NULL;
char *stripcd = NULL;
int needtar = 0;

if ((at = getArchiver(fn)) == NULL)
goto exit;

int needtar = (at->extractable == 0);
needtar = (at->extractable == 0);

if (dstpath) {
char * sr = singleRoot(fn);
Expand Down

0 comments on commit 17e15ba

Please sign in to comment.