--- /usr/bin/xdg-open 2011-06-19 06:51:55.000000000 +0200 +++ xdg-open 2012-01-17 23:07:32.744847991 +0100 @@ -407,8 +407,7 @@ open_generic_xdg_mime() { - filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` - default=`xdg-mime query default "$filetype"` + default=`xdg-mime query default "$2"` if [ -n "$default" ] ; then xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" @@ -447,7 +446,8 @@ fi check_input_file "$file" - open_generic_xdg_mime "$file" + filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` + open_generic_xdg_mime "$file" "$filetype" if [ -f /etc/debian_version ] && which run-mailcap 2>/dev/null 1>&2; then @@ -465,6 +465,12 @@ fi fi + if (echo "$1" | egrep -q '^[a-zA-Z+\.\-]+:'); then + scheme=`echo "$1" | sed "s/^\([a-zA-Z+\.\-]\+\):.*/\1/"` + mimescheme="x-scheme-handler/$scheme" + open_generic_xdg_mime "$1" "$mimescheme" + fi + IFS=":" for browser in $BROWSER; do if [ x"$browser" != x"" ]; then