summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dlg-new.c13
-rw-r--r--src/fr-archive.c2
-rw-r--r--src/fr-command-7z.c33
-rw-r--r--src/fr-command-tar.c3
-rw-r--r--src/glib-utils.c2
5 files changed, 35 insertions, 18 deletions
diff --git a/src/dlg-new.c b/src/dlg-new.c
index 0f0e36e..9a5c79f 100644
--- a/src/dlg-new.c
+++ b/src/dlg-new.c
@@ -269,7 +269,6 @@ dlg_new_archive (FrWindow *window,
{
DlgNewData *data;
GtkWidget *n_new_button;
- GtkFileFilter *filter;
GSettings *settings;
/*char *default_ext;*/
int i;
@@ -309,18 +308,6 @@ dlg_new_archive (FrWindow *window,
if (default_name != NULL)
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (data->dialog), default_name);
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("All archives"));
- for (i = 0; data->supported_types[i] != -1; i++)
- gtk_file_filter_add_mime_type (filter, mime_type_desc[data->supported_types[i]].mime_type);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (data->dialog), filter);
- gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (data->dialog), filter);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("All files"));
- gtk_file_filter_add_pattern (filter, "*");
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (data->dialog), filter);
-
/**/
gtk_button_set_use_stock (GTK_BUTTON (n_new_button), TRUE);
diff --git a/src/fr-archive.c b/src/fr-archive.c
index 56a9918..fcb4c82 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -2911,7 +2911,7 @@ compute_base_path (const char *base_dir,
return new_path;
}
- if (path_len <= base_dir_len)
+ if (path_len < base_dir_len)
return NULL;
base_path = path + base_dir_len;
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index 316df11..20cfa2c 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -371,11 +371,20 @@ fr_command_7z_add (FrCommand *comm,
if (from_file != NULL)
fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL);
+ if (from_file == NULL)
+ for (scan = file_list; scan; scan = scan->next)
+ /* Files prefixed with '@' need to be handled specially */
+ if (g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL);
+
fr_process_add_arg (comm->process, "--");
fr_process_add_arg (comm->process, comm->filename);
+
if (from_file == NULL)
for (scan = file_list; scan; scan = scan->next)
- fr_process_add_arg (comm->process, scan->data);
+ /* Skip files prefixed with '@', already added */
+ if (!g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
}
@@ -399,11 +408,20 @@ fr_command_7z_delete (FrCommand *comm,
if (from_file != NULL)
fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL);
+ if (from_file == NULL)
+ for (scan = file_list; scan; scan = scan->next)
+ /* Files prefixed with '@' need to be handled specially */
+ if (g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL);
+
fr_process_add_arg (comm->process, "--");
fr_process_add_arg (comm->process, comm->filename);
+
if (from_file == NULL)
for (scan = file_list; scan; scan = scan->next)
- fr_process_add_arg (comm->process, scan->data);
+ /* Skip files prefixed with '@', already added */
+ if (!g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
}
@@ -453,11 +471,20 @@ fr_command_7z_extract (FrCommand *comm,
if (from_file != NULL)
fr_process_add_arg_concat (comm->process, "-i@", from_file, NULL);
+ if (from_file == NULL)
+ for (scan = file_list; scan; scan = scan->next)
+ /* Files prefixed with '@' need to be handled specially */
+ if (g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg_concat (comm->process, "-i!", scan->data, NULL);
+
fr_process_add_arg (comm->process, "--");
fr_process_add_arg (comm->process, comm->filename);
+
if (from_file == NULL)
for (scan = file_list; scan; scan = scan->next)
- fr_process_add_arg (comm->process, scan->data);
+ /* Skip files prefixed with '@', already added */
+ if (!g_str_has_prefix (scan->data, "@"))
+ fr_process_add_arg (comm->process, scan->data);
fr_process_end_command (comm->process);
}
diff --git a/src/fr-command-tar.c b/src/fr-command-tar.c
index b870ec5..d52964c 100644
--- a/src/fr-command-tar.c
+++ b/src/fr-command-tar.c
@@ -331,6 +331,7 @@ fr_command_tar_add (FrCommand *comm,
if (! recursive)
fr_process_add_arg (comm->process, "--no-recursion");
fr_process_add_arg (comm->process, "--no-wildcards");
+ fr_process_add_arg (comm->process, "--no-unquote");
fr_process_add_arg (comm->process, "-v");
fr_process_add_arg (comm->process, "-p");
@@ -401,6 +402,7 @@ fr_command_tar_delete (FrCommand *comm,
fr_process_set_begin_func (comm->process, begin_func__delete, comm);
fr_process_add_arg (comm->process, "--force-local");
fr_process_add_arg (comm->process, "--no-wildcards");
+ fr_process_add_arg (comm->process, "--no-unquote");
fr_process_add_arg (comm->process, "-v");
fr_process_add_arg (comm->process, "--delete");
fr_process_add_arg (comm->process, "-f");
@@ -448,6 +450,7 @@ fr_command_tar_extract (FrCommand *comm,
begin_tar_command (comm);
fr_process_add_arg (comm->process, "--force-local");
fr_process_add_arg (comm->process, "--no-wildcards");
+ fr_process_add_arg (comm->process, "--no-unquote");
fr_process_add_arg (comm->process, "-v");
fr_process_add_arg (comm->process, "-p");
diff --git a/src/glib-utils.c b/src/glib-utils.c
index 9761091..27d4548 100644
--- a/src/glib-utils.c
+++ b/src/glib-utils.c
@@ -751,7 +751,7 @@ _g_path_get_base_name (const char *path,
return _g_path_get_file_name (path);
base_dir_len = strlen (base_dir);
- if (strlen (path) <= base_dir_len)
+ if (strlen (path) < base_dir_len)
return NULL;
base_path = path + base_dir_len;