wifi: proper fix for SSID regexp

This commit is contained in:
Adrian C. (anrxc) 2010-10-29 17:50:13 +02:00
parent 7f7a94d795
commit 762593385c
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@
local tonumber = tonumber local tonumber = tonumber
local math = { ceil = math.ceil } local math = { ceil = math.ceil }
local setmetatable = setmetatable local setmetatable = setmetatable
local helpers = require("vicious.helpers")
local io = { local io = {
open = io.open, open = io.open,
popen = io.popen popen = io.popen
@ -57,7 +58,7 @@ local function worker(format, warg)
-- Output differs from system to system, some stats can be -- Output differs from system to system, some stats can be
-- separated by =, and not all drivers report all stats -- separated by =, and not all drivers report all stats
winfo["{ssid}"] = -- SSID can have almost anything in it winfo["{ssid}"] = -- SSID can have almost anything in it
string.match(iw, 'ESSID[=:]"([%w%p]+[%s%w%p]*)"') or winfo["{ssid}"] helpers.escape(string.match(iw, 'ESSID[=:]"(.-)"') or winfo["{ssid}"])
winfo["{mode}"] = -- Modes are simple, but also match the "-" in Ad-Hoc winfo["{mode}"] = -- Modes are simple, but also match the "-" in Ad-Hoc
string.match(iw, "Mode[=:]([%w%-]*)") or winfo["{mode}"] string.match(iw, "Mode[=:]([%w%-]*)") or winfo["{mode}"]
winfo["{chan}"] = -- Channels are plain digits winfo["{chan}"] = -- Channels are plain digits