[Xfce4-commits] r26004 - xarchiver/trunk/src

Giuseppe Torelli colossus at xfce.org
Thu Aug 23 14:29:40 CEST 2007


Author: colossus
Date: 2007-08-23 12:29:40 +0000 (Thu, 23 Aug 2007)
New Revision: 26004

Modified:
   xarchiver/trunk/src/bzip2.c
   xarchiver/trunk/src/extract_dialog.c
   xarchiver/trunk/src/gzip.c
   xarchiver/trunk/src/window.c
Log:
Applied patch by Edward Tomasz Napierala for fixing relative pathname problem in the 
extraction dialog when running 'xarchiver archive.tar.gz'


Modified: xarchiver/trunk/src/bzip2.c
===================================================================
--- xarchiver/trunk/src/bzip2.c	2007-08-23 11:30:28 UTC (rev 26003)
+++ xarchiver/trunk/src/bzip2.c	2007-08-23 12:29:40 UTC (rev 26004)
@@ -35,6 +35,7 @@
 
     if ( g_str_has_suffix ( archive->escaped_path , ".tar.bz2") || g_str_has_suffix ( archive->escaped_path , ".tar.bz") || g_str_has_suffix ( archive->escaped_path , ".tbz") || g_str_has_suffix ( archive->escaped_path , ".tbz2" ) )
 	{
+		archive->type = XARCHIVETYPE_TAR_BZ2;
 		tar = g_find_program_in_path ("gtar");
 		if (tar == NULL)
 			tar = g_strdup ("tar");

Modified: xarchiver/trunk/src/extract_dialog.c
===================================================================
--- xarchiver/trunk/src/extract_dialog.c	2007-08-23 11:30:28 UTC (rev 26003)
+++ xarchiver/trunk/src/extract_dialog.c	2007-08-23 12:29:40 UTC (rev 26004)
@@ -83,7 +83,7 @@
 			strncpy ( extraction_string, archive->path, x - 5);
 			extraction_string[x-5] = '\0';
 		}
-		gtk_entry_set_text (GTK_ENTRY(dialog_data->destination_path_entry), extraction_string);
+		gtk_entry_set_text (GTK_ENTRY(dialog_data->destination_path_entry), g_strdup(extraction_string));
 		g_free (extraction_string);
 	}
 	else
@@ -319,7 +319,6 @@
 			break;
 
 			case GTK_RESPONSE_OK:
-			//TODO: apply Edward's patch
 			destination_path = g_strdup (gtk_entry_get_text ( GTK_ENTRY (dialog_data->destination_path_entry) ));
 			archive->extraction_path = EscapeBadChars ( destination_path , "$\'`\"\\!?* ()&|@#:;" );
 
@@ -328,6 +327,12 @@
 				response = xa_show_message_dialog (GTK_WINDOW (MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK, _("You missed where to extract the files!"),_("Please enter the extraction path.") );
 				break;
 			}
+			if (archive->extraction_path[0] != '/')
+			{
+				gchar *cur_dir = g_get_current_dir();
+				archive->extraction_path = g_strconcat(cur_dir, "/", archive->extraction_path, NULL);
+				g_free (cur_dir);
+			}
 			if (archive->has_passwd)
 				archive->passwd  = g_strdup (gtk_entry_get_text ( GTK_ENTRY (dialog_data->password_entry) ));
 

Modified: xarchiver/trunk/src/gzip.c
===================================================================
--- xarchiver/trunk/src/gzip.c	2007-08-23 11:30:28 UTC (rev 26003)
+++ xarchiver/trunk/src/gzip.c	2007-08-23 12:29:40 UTC (rev 26004)
@@ -32,6 +32,7 @@
 
 	if ( g_str_has_suffix ( archive->escaped_path , ".tar.gz") || g_str_has_suffix ( archive->escaped_path , ".tgz") )
 	{
+		archive->type = XARCHIVETYPE_TAR_GZ;
 	    tar = g_find_program_in_path ("gtar");
 	    if (tar == NULL)
     		tar = g_strdup ("tar");

Modified: xarchiver/trunk/src/window.c
===================================================================
--- xarchiver/trunk/src/window.c	2007-08-23 11:30:28 UTC (rev 26003)
+++ xarchiver/trunk/src/window.c	2007-08-23 12:29:40 UTC (rev 26004)
@@ -1085,7 +1085,6 @@
 		xx = XARCHIVETYPE_LHA;
 	else if ( memcmp ( magic,"!<arch>\ndebian", 14 ) == 0 )
 		xx = XARCHIVETYPE_DEB;
-	//else if ( memcmp (magic,"\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00",12) == 0 ) xx = XARCHIVETYPE_BIN;
 	fclose ( dummy_ptr );
 	return xx;
 }



More information about the Xfce4-commits mailing list