[Portland-bugs] [Bug 45859] New: xdg-open fails to open a url in a "generic" environment

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Feb 9 14:25:56 PST 2012


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

             Bug #: 45859
           Summary: xdg-open fails to open a url in a "generic"
                    environment
    Classification: Unclassified
           Product: Portland
           Version: 1.1.0
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: xdg-utils
        AssignedTo: portland-bugs at lists.freedesktop.org
        ReportedBy: goeran at uddeborg.se


When using xdg-open on a typical URL in an environment which is considered "generic", my browser comes up with to tabs.  One shows www.http.com and the other
tries to open the real URL path as a file, which fails of course.

The reason for this seems to be an improper use of IFS in the script.  The different browsers to try are separated by colons, and to easily loop over them, IFS
is set to colon.  But that will also affect the colon which is typically part of the URL, and split it into two separate arguments to the browser.  See the
output from running xdg-open with "bash -xv" at the end.

This is with xdg-utils-1.1.0-0.10.20111207.fc16.noarch on a Fedora system.

This output comes from running open_generic, starting at line 612 in my copy of xdg-open.  Note that x-www-browser and firefox are called with two separate
arguments, rather than a single URL.

+ IFS=:
+ for browser in '$BROWSER'
+ '[' xx-www-browser '!=' x ']'
printf "$browser" "$1" 2>/dev/null
++ printf x-www-browser http://portland.freedesktop.org/
+ browser_with_arg=x-www-browser
+ '[' 0 -ne 0 ']'
+ '[' xx-www-browser = xx-www-browser ']'
+ eval '$browser $1 > /dev/null 2> /dev/null'
$browser $1 > /dev/null 2> /dev/null
++ x-www-browser http //portland.freedesktop.org/
+ '[' 127 -eq 0 ']'
+ for browser in '$BROWSER'
+ '[' xfirefox '!=' x ']'
printf "$browser" "$1" 2>/dev/null
++ printf firefox http://portland.freedesktop.org/
+ browser_with_arg=firefox
+ '[' 0 -ne 0 ']'
+ '[' xfirefox = xfirefox ']'
+ eval '$browser $1 > /dev/null 2> /dev/null'
$browser $1 > /dev/null 2> /dev/null
++ firefox http //portland.freedesktop.org/
+ '[' 0 -eq 0 ']'
+ exit_success
+ '[' 0 -gt 0 ']'
+ exit 0

-- 
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