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.
This commit is contained in:
Adrian C. (anrxc) 2010-03-07 17:31:49 +01:00
parent 5f41c7a238
commit f34bfaf138
1 changed files with 3 additions and 3 deletions

6
fs.lua
View File

@ -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)