From 6049eaec3f045c8ca9d29c9ae0c042c86e89074b Mon Sep 17 00:00:00 2001 From: Matteo Landi Date: Mon, 18 Aug 2008 16:57:48 +0200 Subject: [PATCH] beautiful: remove tabulations in key/value parsing Signed-off-by: Julien Danjou --- lib/beautiful.lua.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/beautiful.lua.in b/lib/beautiful.lua.in index c2dcdd8d..3c5a9ca3 100644 --- a/lib/beautiful.lua.in +++ b/lib/beautiful.lua.in @@ -28,13 +28,15 @@ local function split_line(line) local split_val = line:find('=') if split_val and line:sub(1, 1) ~= '#' and line:sub(1, 2) ~= '--' then - -- Remove spaces in key and extra spaces before value + -- Remove spaces and tabulations in key + local key = line:sub(1, split_val - 1):gsub(' ', ''):gsub('\t', '') + -- and extra spaces and tabulations before value local value = line:sub(split_val + 1, -1) - while value:sub(1, 1) == ' ' do + while value:sub(1, 1) == ' ' or value:sub(1, 1) == '\t' do value = value:sub(2, -1) end - return line:sub(1, split_val - 1):gsub(' ', ''), value + return key, value end end