From f2f6eb68214df6369486c55563b957c3572a1c9d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 25 Sep 2014 02:47:40 +0200 Subject: [PATCH] menubar: skip comments in .desktop files --- lib/menubar/utils.lua.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/menubar/utils.lua.in b/lib/menubar/utils.lua.in index 5eefe966d..c23e48070 100644 --- a/lib/menubar/utils.lua.in +++ b/lib/menubar/utils.lua.in @@ -129,7 +129,9 @@ function utils.parse(file) -- Parse the .desktop file. -- We are interested in [Desktop Entry] group only. for line in io.lines(file) do - if not desktop_entry and line == "[Desktop Entry]" then + if line:find("^%s*#") then + -- Skip comments. + elseif not desktop_entry and line == "[Desktop Entry]" then desktop_entry = true else if line:sub(1, 1) == "[" and line:sub(-1) == "]" then