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 705746 - relative paths in commandline args not handled properly
relative paths in commandline args not handled properly
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
file-roller-maint
Depends on:
Blocks:
 
 
Reported: 2013-08-10 01:26 UTC by Andreas Henriksson
Modified: 2013-08-10 20:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Handle relative paths in cmdline arguments better (3.49 KB, patch)
2013-08-10 01:36 UTC, Andreas Henriksson
none Details | Review

Description Andreas Henriksson 2013-08-10 01:26:08 UTC
Forwarded from http://bugs.debian.org/718672 :

If file-roller is running, and you attempt to open another archive from
the command line in another directory using a relative path, an error
message appears indicating that file-roller could not find it. Using an
absolute path works. file-roller seems to be resolving the argument
relative to where the first instance was started.

Steps to reproduce (starting without file-roller running):
touch foo
zip foo.zip foo
mkdir bar
zip bar/bar.zip foo
cd bar
file-roller bar.zip &
cd ..
file-roller foo.zip                # fails
file-roller ../foo.zip             # works, but shouldn't
file-roller /full/path/to/foo.zip  # works
Comment 1 Andreas Henriksson 2013-08-10 01:36:39 UTC
Created attachment 251266 [details] [review]
Handle relative paths in cmdline arguments better

File-roller didn't take into account that the
working directory might have changed between
opening the first instance and opening additional
archives on the command line with relative paths.

When a relative path was used for an archive
on the command line, it would always be relative
to the first instance working directory - not to
the launched instance working directory.

This is fixed by using the recently added
g_application_command_line_create_file_for_arg ()
(in gio since 2.36).

Problem reported by John Stumpo <stump@stump.io>
in http://bugs.debian.org/718672
Comment 2 Andreas Henriksson 2013-08-10 01:40:27 UTC
Bumping the required gio version should not be a problem for the master branch, since the required glib version is already at 2.36.

A solution where avoiding bumping requirements is desirable would probably involve g_application_command_line_get_cwd () which is available since 2.28.
Comment 3 Paolo Bacchilega 2013-08-10 20:07:10 UTC
Patch pushed to master now, thank you.