menubar: skip comments in .desktop files

This commit is contained in:
Daniel Hahler 2014-09-25 02:47:40 +02:00
parent a64f8b1385
commit f2f6eb6821
1 changed files with 3 additions and 1 deletions

View File

@ -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