Bug 32487

Summary: xdg-open fallback fails because of variable set in open_generic_xdg_mime()
Product: Portland Reporter: t3slider
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: rwnobrega
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description t3slider 2010-12-17 19:02:22 UTC
open_generic() calls
open_generic_xdg_mime "$file"

In open_generic_xdg_mime(), the existence of the appropriate .desktop file is checked:
file="$x/applications/$default"
if [ -r "$file" ] ; then

This of course resets the $file variable that was originally passed to open_generic_xdg_mime() (referenced by $1 in the function), and if open_generic_xdg_mime() fails then it tries to fallback to run-mailcap or mimeinfo, using $file as the parameter (which now references a .desktop file). Launching via the browser fallback should still work because it uses $1, but $file was used in open_generic() for a reason. Additionally, if the fallback is used, it will open the .desktop file in the default editor instead of failing and passing to the browser-based fallback.

Line 395 should declare file as local, or the variable in open_generic_xdg_mime() should be renamed.
Comment 2 Rex Dieter 2011-07-05 09:42:06 UTC
*** Bug 38047 has been marked as a duplicate of this bug. ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.