From 4602ca2fa5e8e2e408713f72ae7e4cd14480bc01 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Mon, 5 Oct 2009 00:10:47 +0200 Subject: Lots of coding style changes --- fs.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs.lua') diff --git a/fs.lua b/fs.lua index a65a1ff..3aaaefb 100644 --- a/fs.lua +++ b/fs.lua @@ -7,6 +7,7 @@ -- {{{ Grab environment local io = { popen = io.popen } local setmetatable = setmetatable +local string = { match = string.match } -- }}} @@ -24,10 +25,10 @@ local function worker(format, nfs) local fs_info = {} for line in f:lines() do - if not line:match("^Filesystem.*") then + if not string.match(line, "^Filesystem.*") then local size, used, avail, usep, mount = -- Match all at once, including network file systems - line:match("^[%w%p]+[%s]+([%d%.]+)[%a]?[%s]+([%d%.]+)[%a]?[%s]+([%d%.]+)[%a]?[%s]+([%d]+)%%[%s]+([%w%p]+)$") + string.match(line, "^[%w%p]+[%s]+([%d%.]+)[%a]?[%s]+([%d%.]+)[%a]?[%s]+([%d%.]+)[%a]?[%s]+([%d]+)%%[%s]+([%w%p]+)$") fs_info["{"..mount.." size}"] = size fs_info["{"..mount.." used}"] = used -- cgit v1.2.3