aboutsummaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-10-29 17:50:13 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-10-29 17:50:13 +0200
commit762593385c2492e630946b9253083367bee19181 (patch)
treed4f689b27bb80d96560119b8219465dd843b0d1d /widgets
parent7f7a94d7959c970937c803f19416494cb55ae1e3 (diff)
downloadvicious-legacy-762593385c2492e630946b9253083367bee19181.tar.xz
wifi: proper fix for SSID regexp
Diffstat (limited to 'widgets')
-rw-r--r--widgets/wifi.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/widgets/wifi.lua b/widgets/wifi.lua
index f2e2b7d..3e30dc9 100644
--- a/widgets/wifi.lua
+++ b/widgets/wifi.lua
@@ -7,6 +7,7 @@
local tonumber = tonumber
local math = { ceil = math.ceil }
local setmetatable = setmetatable
+local helpers = require("vicious.helpers")
local io = {
open = io.open,
popen = io.popen
@@ -57,7 +58,7 @@ local function worker(format, warg)
-- Output differs from system to system, some stats can be
-- separated by =, and not all drivers report all stats
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
string.match(iw, "Mode[=:]([%w%-]*)") or winfo["{mode}"]
winfo["{chan}"] = -- Channels are plain digits