summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--lib/format.lua8
-rw-r--r--lib/processinfo.lua4
3 files changed, 5 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index fc0e74f..4a6d2c3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
APP_NAME=core
PACKAGE=acf-$(APP_NAME)
-VERSION=0.6.0
+VERSION=0.6.1
P=$(PACKAGE)-$(VERSION)
DISTDIR:=$(shell pwd)/$(P)
diff --git a/lib/format.lua b/lib/format.lua
index 9492eca..63b8fec 100644
--- a/lib/format.lua
+++ b/lib/format.lua
@@ -175,14 +175,10 @@ function string_to_table ( text, delimiter)
while 1 do
local first, last = string.find(text, delimiter, pos)
if first then -- found?
- if first > pos then
- table.insert(list, string.sub(text, pos, first-1))
- end
+ table.insert(list, string.sub(text, pos, first-1))
pos = last+1
else
- if pos < string.len(text) then
- table.insert(list, string.sub(text, pos))
- end
+ table.insert(list, string.sub(text, pos))
break
end
end
diff --git a/lib/processinfo.lua b/lib/processinfo.lua
index ec232aa..5e5136a 100644
--- a/lib/processinfo.lua
+++ b/lib/processinfo.lua
@@ -48,9 +48,9 @@ function read_initrunlevels()
local cmdresult = f:read("*a") or ""
f:close()
for line in string.gmatch(cmdresult, "([^\n]*)\n?") do
- local service, runlevels = string.match(line, "^%s*(%w+) |(.*)")
+ local service, runlevels = string.match(line, "^%s*(%w+) |%s*(.*)")
if service then
- local runlevel = format.string_to_table(runlevels, "%s+") or {}
+ local runlevel = format.string_to_table(string.gsub(runlevels, "%s+$", ""), "%s+") or {}
config[#config+1] = {servicename=service, runlevels=runlevel}
end
end