--- /usr/bin/xdg-open.bkp 2014-04-26 22:47:15.050861481 +0200 +++ /usr/bin/xdg-open 2014-04-26 23:21:41.684285379 +0200 @@ -156,9 +156,9 @@ grep -q "^Exec.*$base" "$file" || continue # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - if [ x"`readlink -f "$command"`" = x"$binary" ]; then + comm="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + comm="`which "$comm"`" + if [ x"`readlink -f "$comm"`" = x"$binary" ]; then # Fix any double slashes that got added path composition echo "$file" | sed -e 's,//*,/,g' return @@ -181,9 +181,9 @@ file="$dir/applications/$desktop" [ -r "$file" ] || continue # Remove any arguments (%F, %f, %U, %u, etc.). - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - readlink -f "$command" + comm="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + comm="`which "$comm"`" + readlink -f "$comm" return done } @@ -573,8 +573,8 @@ fi if [ -r "$file" ] ; then - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command_exec=`which $command 2>/dev/null` + comm="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command_exec=`which $comm 2>/dev/null` arguments="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | last_word`" arg_one="`echo "$arg" | sed 's/[&*\\]/\\\\&/g'`" arguments_exec="`echo "$arguments" | sed -e 's*%[fFuU]*"'"$arg_one"'"*g'`" @@ -646,7 +646,9 @@ file=${file#file://} file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" fi - check_input_file "$file" + file_check=${file%%#*} + file_check=${file_check%%\?*} + check_input_file "$file_check" open_generic_xdg_file_mime "$file"