I started noticing this error in my terminal from quassel-client: /usr/bin/xdg-mime: line 323: [: too many arguments /usr/bin/xdg-mime: line 325: [: too many arguments /usr/bin/xdg-mime: line 323: [: too many arguments /usr/bin/xdg-mime: line 325: [: too many arguments The relevant lines are the obviously dangerous: if [ -r $dir/applications/$vendor/$app ]; then file_path=$dir/applications/$vendor/$app elif [ -r $dir/applnk/$vendor/$app ]; then file_path=$dir/applnk/$vendor/$app fi echoing the value of "vendor" and "app" indicates they *both* contain spaces: echo "vendor: '${vendor}'" >&2 echo "app: '${app}'" >&2 vendor: 'userapp-Pale Moon' app: 'Pale Moon-FGUVNY.desktop' Surprise, this looks a lot like bug #540628 ---- x11-misc/xdg-utils-1.1.2::gentoo was built with the following: USE="perl -doc" ABI_X86="(64)" Timestamp of repository gentoo: Wed, 21 Jun 2017 15:30:01 +0000 Last change to xdg-utils-1.1.2: commit ada30fbff65f62fc734c992a3961aac6873ba69e Date: 2017-05-09 13:12:53 +1200
According to the Desktop Entry Specification, spaces are not valid in .desktop file names. https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html "The valid characters (aside '.') are [A-Z][a-z][0-9] along with dash ('-') and underscore ('_'). Components may not begin with a digit." That said, this still seems like sloppy shell coding.
Please report this to upstream and post the link here to let us track the issue: https://bugs.freedesktop.org/enter_bug.cgi?product=Portland&component=xdg-utils
Is this still valid with 1.1.3?
(In reply to Johannes Huber from comment #3) > Is this still valid with 1.1.3? /usr/bin/xdg-mime: line 323: [: too many arguments /usr/bin/xdg-mime: line 325: [: too many arguments $ xdg-mime --version xdg-mime 1.1.3 Yes.
Created attachment 576710 [details, diff] xdg-utils-fix-unquoted-paths.patch Could someone who can reproduce the issue please test out this patch and confirm it fixes the problem?
Tried your patch, works fine here. Thanks!