From cc686869e9801b09abc29a3e72718ae0520aa97e Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Sat, 8 Dec 2018 19:56:44 +0100 Subject: [PATCH] xdg-open: Fix unquoted variable expansion when looking for .desktop files The recursive find algorithm for the .desktop files has an unquoted path expansion in the generic case, when no desktop environment specific tool is found. Hence, if we have a directory layout containing something along the lines of ~/.local/share/applications/foo bar/ Then the recursion will expand into searching in: * `~/.local/share/applications/foo` * `~/bar/*` instead of `~/.local/share/applications/foo bar/*` --- scripts/xdg-open.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in index 202f3e3..b3e0ba9 100644 --- a/scripts/xdg-open.in +++ b/scripts/xdg-open.in @@ -328,7 +328,7 @@ search_desktop_file() fi fi - for d in $dir/*/; do + for d in "$dir"/*/; do [ -d "$d" ] && search_desktop_file "$default" "$d" "$target" done } -- 2.21.0