--- /usr/bin/xdg-open 2010-06-18 00:20:30.000000000 -0500 +++ xdg-open 2010-09-29 04:48:25.000000000 -0500 @@ -332,6 +332,13 @@ echo "$first" } +last_word() +{ + read first rest + echo "$rest" +} + + open_kde() { if kde-open -v 2>/dev/null 1>&2; then @@ -394,8 +401,16 @@ if [ -r "$file" ] ; then command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" command_exec=`which $command 2>/dev/null` + arguments="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | last_word`" + arguments_exec="`echo $arguments | sed -e 's*%[fF]*"'"$1"'"*g'`" + if [ -x "$command_exec" ] ; then - $command_exec "$1" + if echo $arguments | grep -iq '%f' ; then + eval $command_exec $arguments_exec + else + eval $command_exec $arguments_exec "$1" + fi + if [ $? -eq 0 ]; then exit_success fi