diff options
author | raveit65 <[email protected]> | 2015-10-14 20:23:41 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2015-10-14 20:23:41 +0200 |
commit | d905fba84d8a21491c368b7a78cd8a064954ffe7 (patch) | |
tree | bc9df1d33151a284a65024dfb41f4c54b0bd153c /src/fr-window.c | |
parent | ef693f552dfb377625f4dc6b739846e3a5312394 (diff) | |
download | engrampa-d905fba84d8a21491c368b7a78cd8a064954ffe7.tar.bz2 engrampa-d905fba84d8a21491c368b7a78cd8a064954ffe7.tar.xz |
fixed overwrite check when the files to be extracted are inside a folder
author ZenWalker <[email protected]>
fixes https://github.com/mate-desktop/engrampa/issues/103
Diffstat (limited to 'src/fr-window.c')
-rw-r--r-- | src/fr-window.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/fr-window.c b/src/fr-window.c index ed6f76a..1adf401 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -6742,14 +6742,16 @@ _fr_window_ask_overwrite_dialog (OverwriteData *odata) gboolean do_not_extract = FALSE; while ((odata->edata->overwrite == FR_OVERWRITE_ASK) && (odata->current_file != NULL)) { - char *path; - char *dest_uri; - GFile *file; - GFileInfo *info; - GFileType file_type; - - path = g_uri_escape_string ((char *) odata->current_file->data, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE); - dest_uri = g_strdup_printf ("%s/%s", odata->edata->extract_to_dir, path); + const char *base_name; + char *e_base_name; + char *dest_uri; + GFile *file; + GFileInfo *info; + GFileType file_type; + + base_name = _g_path_get_base_name ((char *) odata->current_file->data, odata->edata->base_dir, odata->edata->junk_paths); + e_base_name = g_uri_escape_string (base_name, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE); + dest_uri = g_strdup_printf ("%s/%s", odata->edata->extract_to_dir, e_base_name); file = g_file_new_for_uri (dest_uri); info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_NAME "," G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, @@ -6758,7 +6760,7 @@ _fr_window_ask_overwrite_dialog (OverwriteData *odata) NULL); g_free (dest_uri); - g_free (path); + g_free (e_base_name); if (info == NULL) { g_object_unref (file); @@ -6802,6 +6804,8 @@ _fr_window_ask_overwrite_dialog (OverwriteData *odata) return; } + else + odata->current_file = odata->current_file->next; g_object_unref (info); g_object_unref (file); |