GNOME Bugzilla – Bug 136570
the -e option seems to work only for absolute paths
Last modified: 2004-12-22 21:47:04 UTC
Description The -e option seems to work only for absolute paths. Any other paths like ./<directory> etc. do not work. Steps to Reproduce the bug 1. Open up a terminal 2. Type: $ file-roller -e "<any relative path>" <archive-name> Ex: $ file-roller -e "./extracts" my-archive.tgz 3. Expected Result: The archive's contents should be extracted to the specified path. 4. Observed Result: A message box saying "Destination folder does not exist. Do you want to create it?" On replying as "Create folder" to the above message box, another error message box opens up saying "Could not create folder" and no extraction operation is done.
Created attachment 25568 [details] [review] this is my proposed patch for this bug
Srinath, you forgot to take care of the absolute path, means if the user gives file-roller -e <absolute path of the directory> <archive-name> what will happen? Attaching a modified patch. Thanks.
shakti, i have taken care of that condition....as if( !g_path_is_absolute(extract_to) ) { ... } i think the patch i've submitted is fine.
you have to add an else condition: + if( !g_path_is_absolute(extract_to) ) { + char *full_path; + char *current_dir = g_get_current_dir(); + full_path = g_strconcat( current_dir, "/", extract_to, NULL ); + g_free(current_dir); + extract_to_path = get_path_from_url (full_path); + g_free(full_path); + } else + extract_to_path = get_path_from_url (extract_to); I can't apply the patch because there is a code freeze now (I don't want to break other freezes ;), I'll apply the patch after version 2.6.0 is out, thank you.
yes..i forgot to add that else condition. So do i have to supply the modified patch again??
Created attachment 25660 [details] [review] Proposed patch
Paolo, I have used g_build_filename() instead of g_strconcat(). Is it fine?
yes g_build_filename is fine, and the patch has been applied now.