summaryrefslogtreecommitdiff
path: root/user/xdg-utils/xdg-open-spaces.patch
blob: 7583a9dc368035ad7aeb52dde829502a52c75bbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From cc686869e9801b09abc29a3e72718ae0520aa97e Mon Sep 17 00:00:00 2001
From: Dominik Schmidt <dominik@schm1dt.ch>
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