Comparison

clix.lua @ 34:d4f8fc71d936

clix.lua: Only set config key on valid lines
author Matthew Wild <mwild1@gmail.com>
date Sun, 30 May 2010 02:13:05 +0100
parent 33:f1901c9de891
child 35:37540f89d4e2
comparison
equal deleted inserted replaced
33:f1901c9de891 34:d4f8fc71d936
44 if not current_account then -- This is the first defined account 44 if not current_account then -- This is the first defined account
45 accounts.default = accounts[current_account]; 45 accounts.default = accounts[current_account];
46 end 46 end
47 elseif current_account then 47 elseif current_account then
48 local k,v = line:match("^(%w+)%s*[:=]%s*(.+)$"); 48 local k,v = line:match("^(%w+)%s*[:=]%s*(.+)$");
49 accounts[current_account or "default"][k] = v; 49 if k then
50 accounts[current_account or "default"][k] = v;
51 end
50 end 52 end
51 end 53 end
52 54
53 function clix_connect(opts, on_connect) 55 function clix_connect(opts, on_connect)
54 local account = accounts[opts.account or "default"]; 56 local account = accounts[opts.account or "default"];