Bug 219002 - Gobby won't open files because it corrupts the pathname
Summary: Gobby won't open files because it corrupts the pathname
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gobby
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Luke Macken
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-09 00:40 UTC by Ian Laurie
Modified: 2016-09-20 02:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-09 01:44:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ian Laurie 2006-12-09 00:40:49 UTC
Description of problem:
Gobby does weird things to the file name argument so that you cannot specify
a file's absolute pathname to the program.  It seems to want to add the user's
home directory in front of the specified file.

Version-Release number of selected component (if applicable):
gobby-0.4.1-1.fc6

How reproducible:
Always

Steps to Reproduce:
1. From a shell type "gobby /root/src/foo.c
2. Gobby reports no such file as /root/root/src/foo.c
3.
  
Actual results:
It has added the user's home directory to the specified path and thus
created an incorrect pathname.

Expected results:
Should use the supplied argument, or document in 'gobby --help' that it expects
a pathname argument "relative" to the user's home directory.  Also the hooks to
use gobby from Nautilus don't provide gobby with a pathname it can use.

Additional info:
Right clicking in Nautilus and selecting to open a file with gobby also
produces this error.

Comment 1 Luke Macken 2007-01-08 19:45:02 UTC
I wrote the following patch, added it to the devel branch, and tagged and built
gobby-0.4.1-2.fc7.

--- src/main.cpp.orig	2007-01-08 14:23:17.000000000 -0500
+++ src/main.cpp	2007-01-08 14:25:29.000000000 -0500
@@ -185,10 +185,17 @@
 	{
 		// Make absolute filenames to understand the files
 		// from everywhere when we send them to another process
-		files[i - 1] = Glib::build_filename(
-			Glib::get_current_dir(),
-			argv[i]
-		);
+		if(Glib::path_is_absolute(argv[i]))
+		{
+			files[i - 1] = argv[i];
+		}
+		else
+		{
+			files[i - 1] = Glib::build_filename(
+				Glib::get_current_dir(),
+				argv[i]
+			);
+		}
 	}
 
 	Gobby::IconManager icon_mgr;

I opened the following ticket upstream to try and get this patch applied:
http://darcs.0x539.de/trac/obby/cgi-bin/trac.cgi/ticket/239

Comment 2 Luke Macken 2007-01-09 01:44:57 UTC
I applied this patch to FC-6 branch and kicked off a build.  This issue was
already fixed upstream (with a patch that's essentially the same as above).


Note You need to log in before you can comment on or make changes to this bug.