After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 136570 - the -e option seems to work only for absolute paths
the -e option seems to work only for absolute paths
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
2.5.x
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2004-03-08 17:16 UTC by srinath
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
this is my proposed patch for this bug (782 bytes, patch)
2004-03-12 17:10 UTC, srinath
none Details | Review
Proposed patch (1.46 KB, patch)
2004-03-15 03:32 UTC, shakti
none Details | Review

Description srinath 2004-03-08 17:16:07 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.
Comment 1 srinath 2004-03-12 17:10:06 UTC
Created attachment 25568 [details] [review]
this is my proposed patch for this bug
Comment 2 shakti 2004-03-13 11:21:13 UTC
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.
Comment 3 srinath 2004-03-13 17:39:07 UTC
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.
Comment 4 Paolo Bacchilega 2004-03-13 19:06:13 UTC
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.
Comment 5 srinath 2004-03-14 13:29:57 UTC
yes..i forgot to add that else condition. So do i have to supply the
modified patch again??
Comment 6 shakti 2004-03-15 03:32:12 UTC
Created attachment 25660 [details] [review]
Proposed patch
Comment 7 shakti 2004-03-15 03:36:19 UTC
Paolo, I have used g_build_filename() instead of g_strconcat(). Is it
fine?
Comment 8 Paolo Bacchilega 2004-04-02 12:45:43 UTC
yes g_build_filename is fine, and the patch has been applied now.