aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yakushev <yakushev.alex@gmail.com>2010-11-04 18:16:05 +0200
committerAlexander Yakushev <yakushev.alex@gmail.com>2010-11-04 18:16:05 +0200
commit39e706d54a139f0fa2490186ef13e3a196e3427d (patch)
treea3d1023106f2b4341b943fb2bbfcd422e70477ba
parentceb98c8c1dc5a1523d17d14a1a21b77f8fb165ea (diff)
downloadawesompd-39e706d54a139f0fa2490186ef13e3a196e3427d.tar.gz
awesompd-39e706d54a139f0fa2490186ef13e3a196e3427d.tar.bz2
Severe bug with last list element fixed
-rw-r--r--awesompd.lua5
1 files changed, 1 insertions, 4 deletions
diff --git a/awesompd.lua b/awesompd.lua
index a12e52d..8b854ba 100644
--- a/awesompd.lua
+++ b/awesompd.lua
@@ -334,7 +334,7 @@ function awesompd:check_list()
if info ~= self.list_line then
self.list_line = info
if string.len(info) > 0 then
- self.list_array = self.split(info,"\n")
+ self.list_array = self.split(string.sub(info,1,string.len(info)),"\n")
else
self.list_array = {}
end
@@ -419,11 +419,8 @@ function awesompd.split (s,t)
l[l.n] = s
end
local p = "%s*(.-)%s*"..t.."%s*"
- s = string.gsub(s,"^%s+","")
- s = string.gsub(s,"%s+$","")
s = string.gsub(s,p,f)
l.n = l.n + 1
- l[l.n] = string.gsub(s,"(%s%s*)$","")
return l
end