Group :: Ferramentas de Arquivo
RPM: xarchiver
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: xarchiver-0.5.4-alt-tar-detection.patch
Download
Download
diff --git a/src/main.c b/src/main.c
index 825b80b..161ac83 100644
--- a/src/main.c
+++ b/src/main.c
@@ -477,13 +477,27 @@ void xa_set_available_archivers()
}
absolute_path = g_find_program_in_path("gtar");
-
- if (absolute_path == NULL)
+ if (absolute_path)
+ {
+ tar = "gtar";
+ g_free (absolute_path);
+ }
+ else
+ {
+ absolute_path = g_find_program_in_path("tar");
+ if (absolute_path)
+ {
+ tar = "tar";
+ g_free (absolute_path);
+ }
+ else
+ tar = NULL;
+ }
+
+ if (tar)
{
- tar = "tar";
ArchiveType = g_list_append(ArchiveType, "tar");
ArchiveSuffix = g_list_append(ArchiveSuffix, "*.tar");
- g_free (absolute_path);
if ( g_list_find ( ArchiveType , "bz2") )
{
ArchiveType = g_list_append(ArchiveType, "tar.bz2");
@@ -512,7 +526,9 @@ void xa_set_available_archivers()
}
}
else
- tar = "gtar";
+ /* to avoid potential crashes if tar variable will be used
+ * without check for NULL */
+ tar = "tar";
absolute_path = g_find_program_in_path ("zip");
if (absolute_path)