[Portland-bugs] [Bug 32487] New: xdg-open fallback fails because of variable set in open_generic_xdg_mime()

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Dec 17 19:02:22 PST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=32487

           Summary: xdg-open fallback fails because of variable set in
                    open_generic_xdg_mime()
           Product: Portland
           Version: unspecified
          Platform: All
        OS/Version: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: xdg-utils
        AssignedTo: portland-bugs at lists.freedesktop.org
        ReportedBy: t3slider at gmail.com


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.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Portland-bugs mailing list