diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-05-26 16:00:59 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-05-26 16:00:59 +0000 |
commit | 9b934599d84f0b3dd32cda657790dc2c34bd95d8 (patch) | |
tree | 29b6dd6a11c40d799add39074d1e40128d4da9dc /lib/format.lua | |
parent | a82f5d48a729e17382790588efc251bdea5a23f1 (diff) | |
download | acf-core-9b934599d84f0b3dd32cda657790dc2c34bd95d8.tar.bz2 acf-core-9b934599d84f0b3dd32cda657790dc2c34bd95d8.tar.xz |
Updates for alpine 1.9 apk tools and openrc. Bug fix for format.lua string_to_table.
Diffstat (limited to 'lib/format.lua')
-rw-r--r-- | lib/format.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/format.lua b/lib/format.lua index 63b8fec..9492eca 100644 --- a/lib/format.lua +++ b/lib/format.lua @@ -175,10 +175,14 @@ function string_to_table ( text, delimiter) while 1 do local first, last = string.find(text, delimiter, pos) if first then -- found? - table.insert(list, string.sub(text, pos, first-1)) + if first > pos then + table.insert(list, string.sub(text, pos, first-1)) + end pos = last+1 else - table.insert(list, string.sub(text, pos)) + if pos < string.len(text) then + table.insert(list, string.sub(text, pos)) + end break end end |