Bug#654863: xdg-open: fails with URLs containing ampersands

2012-01-09 Thread Cyril Soldani
On Sun, 08 Jan 2012 18:57:48 +0100 Per Olofsson pe...@dsv.su.se wrote: Apparently, the only two characters to be escaped are and \ (both for sed and for awk). '\' is not allowed unescaped in URI's though. But it is probably safer to escape it as well. I agree. Although my example was a

Bug#654863: xdg-open: fails with URLs containing ampersands

2012-01-08 Thread Per Olofsson
2012-01-06 16:03, Cyril Soldani skrev: On Fri, 06 Jan 2012 15:18:13 +0100 Per Olofsson pe...@dsv.su.se wrote: Hmm, perhaps it is better to use awk here. How about this: arguments_exec=`echo $arguments | awk -v url=$1 \ '{gsub(/%[fFuU]/, url); print}'` I think the problem stays the

Bug#654863: xdg-open: fails with URLs containing ampersands

2012-01-06 Thread Cyril Soldani
Package: xdg-utils Version: 1.1.0~rc1+git20111210-4 Severity: normal Tags: patch Dear Maintainer, When trying to open an HTTP(S) URL containing ampersands with xdg-open, it fails. Rather than passing the given URL to the browser, it replaces ampersands with '%u' (which becomes %25u, once

Bug#654863: xdg-open: fails with URLs containing ampersands

2012-01-06 Thread Per Olofsson
Hi, 2012-01-06 12:39, Cyril Soldani skrev: Investigating a bit, I found the problem to be at line 552 of xdg-open: arguments_exec=`echo $arguments | sed -e 's*%[fFuU]*'$1'*g'` In our case, $arguments contains '%u'. The problem is with the sed expression, which uses $1 (our URL) without

Bug#654863: xdg-open: fails with URLs containing ampersands

2012-01-06 Thread Cyril Soldani
On Fri, 06 Jan 2012 15:18:13 +0100 Per Olofsson pe...@dsv.su.se wrote: Hmm, perhaps it is better to use awk here. How about this: arguments_exec=`echo $arguments | awk -v url=$1 \ '{gsub(/%[fFuU]/, url); print}'` I think the problem stays the same, as GNU awk also replaces ampersands