[Xfce4-commits] r24735 - squeeze/trunk/libsqueeze
Stephan Arts
stephan at xfce.org
Thu Jan 25 00:10:28 CET 2007
Author: stephan
Date: 2007-01-24 23:10:28 +0000 (Wed, 24 Jan 2007)
New Revision: 24735
Modified:
squeeze/trunk/libsqueeze/archive-support-compr.c
Log:
fix extract-all for compressed files
Modified: squeeze/trunk/libsqueeze/archive-support-compr.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-support-compr.c 2007-01-24 22:57:48 UTC (rev 24734)
+++ squeeze/trunk/libsqueeze/archive-support-compr.c 2007-01-24 23:10:28 UTC (rev 24735)
@@ -164,7 +164,28 @@
else
{
gchar *archive_path = g_shell_quote(archive->path);
- gchar *file_path = g_strconcat(extract_path, "/", filenames->data, NULL);
+ gchar *file_path;
+ if(filenames)
+ file_path = g_strconcat(extract_path, "/", filenames->data, NULL);
+ else
+ {
+ gchar *filename = g_strdup(lsq_archive_get_filename(archive));
+ gint len = strlen(filename);
+ if(g_str_has_suffix(lsq_archive_get_filename(archive), ".gz"))
+ {
+ filename[len-3] = '\0';
+ }
+ if(g_str_has_suffix(lsq_archive_get_filename(archive), ".bz"))
+ {
+ filename[len-3] = '\0';
+ }
+ if(g_str_has_suffix(lsq_archive_get_filename(archive), ".bz2"))
+ {
+ filename[len-4] = '\0';
+ }
+ file_path = g_strconcat(extract_path, "/", filename, NULL);
+ g_free(filename);
+ }
if(!g_strcasecmp(thunar_vfs_mime_info_get_name(archive->mime_info), "application/x-gzip"))
command = g_strconcat("gunzip -c ", archive_path, NULL);
More information about the Xfce4-commits
mailing list