GNOME Bugzilla – Bug 705746
relative paths in commandline args not handled properly
Last modified: 2013-08-10 20:07:10 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
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
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.
Patch pushed to master now, thank you.