aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-07 17:31:49 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-07 17:31:49 +0100
commitf34bfaf1384dfb2c3f1e357bd415aad7e28a6eca (patch)
tree3aa26076283ca5dbd1d474c919a5a7192d614d1f
parent5f41c7a23857cc52ea09b657cf190ff7ef02fdcc (diff)
downloadvicious-legacy-f34bfaf1384dfb2c3f1e357bd415aad7e28a6eca.tar.xz
fs: fix the bug reported by Alex Tergeland
The regexp did not match for him. Now there is also a handler so the widget does not break if it happens again.
-rw-r--r--fs.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs.lua b/fs.lua
index 276ca92..4b2f598 100644
--- a/fs.lua
+++ b/fs.lua
@@ -30,10 +30,10 @@ local function worker(format, nfs)
local fs_info = {}
for line in f:lines() do
- if not string.match(line, "^Filesystem.*") then
- local s, u, a, p, m = string.match(line, -- Match all at once (including NFS)
- "^[%w%p]+[%s]+([%d]+)[%s]+([%d]+)[%s]+([%d]+)[%s]+([%d]+)%%[%s]+([%w%p]+)$")
+ local s, u, a, p, m = string.match(line, -- Match all at once (including NFS)
+ "[%w%p]+[%s]+([%d]+)[%s]+([%d]+)[%s]+([%d]+)[%s]+([%d]+)%%[%s]+([%w%p]+)$")
+ if m ~= nil then
helpers.uformat(fs_info, m .. " size", s, unit)
helpers.uformat(fs_info, m .. " used", u, unit)
helpers.uformat(fs_info, m .. " avail", a, unit)