Bug 23319

Summary: xdg-open can't handle arguments with # symbol
Product: Portland Reporter: Dmitry Marakasov <amdmi3>
Component: xdg-utilsAssignee: Fathi Boudra <fabo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: dimich.dmb
Version: 1.0Keywords: patch
Hardware: x86 (IA32)   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:

Description Dmitry Marakasov 2009-08-14 18:55:40 UTC
xdg-utils 1.0.2, FreeBSD 8.0-BETA i386.

# xdg-open "http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/applications.html#PORTS-MAJOR-UPGRADE"
sed: 1: "s#%s#http://www.freebsd ...": bad flag in substitute command: 'P'

xdg-open:367:
browser_with_arg=`echo "$browser" | sed s#%s#"$1"#`

obviously, $1 should be escaped, or (likely better) printf should be used instead of echo.
Comment 1 Fathi Boudra 2009-08-18 09:08:48 UTC
related to bug 20015: http://bugs.freedesktop.org/show_bug.cgi?id=20015
we should fix both issue at the same time.
Comment 2 Dmitry Marakasov 2009-08-19 16:09:04 UTC
FYI, fix used in FreeBSD for the time being:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/xdg-utils/files/patch-scripts_xdg-open?rev=1.2;content-type=text%2Fplain
Comment 3 Fathi Boudra 2009-10-12 05:51:42 UTC
*** Bug 24375 has been marked as a duplicate of this bug. ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.