Bug#964949: Cannot open files beginning with a dash ('-')
Enrico Zini
enrico at debian.org
Mon Jul 13 09:50:34 BST 2020
Package: xdg-utils
Version: 1.1.3-1+deb10u1
Severity: important
Hello,
thank you for maintaining xdg-open.
There seems to be no way to use it to open a file whose name begins with
a dash:
$ sh -x `which xdg-open` -test.pdf
+ check_common_commands -test.pdf
+ [ 1 -gt 0 ]
+ parm=-test.pdf
+ shift
+ [ 0 -gt 0 ]
+ [ -z ]
+ unset XDG_UTILS_DEBUG_LEVEL
+ [ 0 -lt 1 ]
+ xdg_redirect_output= > /dev/null 2> /dev/null
+ [ x-test.pdf != x ]
+ url=
+ [ 1 -gt 0 ]
+ parm=-test.pdf
+ shift
+ exit_failure_syntax unexpected option '-test.pdf'
+ [ 1 -gt 0 ]
+ echo xdg-open: unexpected option '-test.pdf'
xdg-open: unexpected option '-test.pdf'
+ echo Try 'xdg-open --help' for more information.
Try 'xdg-open --help' for more information.
+ exit 1
I also tried the usual double-dash approach, which doesn't seem to be
supported:
$ sh -x `which xdg-open` -- -test.pdf
+ check_common_commands -- -test.pdf
+ [ 2 -gt 0 ]
+ parm=--
+ shift
+ [ 1 -gt 0 ]
+ parm=-test.pdf
+ shift
+ [ 0 -gt 0 ]
+ [ -z ]
+ unset XDG_UTILS_DEBUG_LEVEL
+ [ 0 -lt 1 ]
+ xdg_redirect_output= > /dev/null 2> /dev/null
+ [ x-- != x ]
+ url=
+ [ 2 -gt 0 ]
+ parm=--
+ shift
+ exit_failure_syntax unexpected option '--'
+ [ 1 -gt 0 ]
+ echo xdg-open: unexpected option '--'
xdg-open: unexpected option '--'
+ echo Try 'xdg-open --help' for more information.
Try 'xdg-open --help' for more information.
+ exit 1
Enrico
-- Package-specific info:
Desktop environment: XDG_CURRENT_DESKTOP=XFCE
-- System Information:
Debian Release: 10.4
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.6.0-0.bpo.2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), LANGUAGE=en_IE:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
xdg-utils depends on no packages.
Versions of packages xdg-utils recommends:
ii libfile-mimeinfo-perl 0.29-1
ii libnet-dbus-perl 1.1.0-5+b1
ii libx11-protocol-perl 0.56-7
ii x11-utils 7.7+4
ii x11-xserver-utils 7.7+8
xdg-utils suggests no packages.
-- no debconf information
More information about the Pkg-freedesktop-maintainers
mailing list